Use the custom implementation in the following KB article: https://docs.telerik.com/devtools/winforms/knowledge-base/radmap-export-to-an-image?_ga=2.41263138.1402359144.1621138970-937174403.1607349180
The pins are successfully exported in version 2021.1.204:
After upgrading to version 2021.2.511, the pins are not exported anymore:
Hi, Ketan,
We have refactored the MapPin's rendering which affects the implementation in the KB article. You can use the following export option in the latest version:
public static Bitmap ToImage(RadMap map, MapLayer layer)
{
var mapElement = map.MapElement;
var bitmap = new Bitmap((int)mapElement.ViewportInPixels.Size.Width, (int)mapElement.ViewportInPixels.Height);
var g = new RadGdiGraphics(Graphics.FromImage(bitmap));
foreach (MapVisualElement element in mapElement.Providers[0].GetContent(mapElement))
{
element.Paint(g, mapElement);
}
object state = g.SaveState();
//comment this line
// g.TranslateTransform(-mapElement.ViewportInPixels.X, -mapElement.ViewportInPixels.Y);
layer.Paint(g, mapElement);
g.RestoreState(state);
return bitmap;
}
We will update the KB article accordingly.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.