How to Save Map Image? - MapXtreme
Export Map as Image
Pleas find the below code snippet to save map image and export map in png format using MapXtreme in asp.net webapplication.
Default.aspx.cs
protected void ExportMap(string mapAlias){
try
{
mapAlias = "World";
Map nmap = GetMapObj(mapAlias);
MapExport objexp = new MapExport(nmap);
objexp.ExportSize = new MapInfo.Mapping.ExportSize(600, 600);
objexp.Format = ExportFormat.Png;
objexp.Export("D:\\ImageMap.Png");
}
catch (Exception ex)
{
throw ex;
}
}
protected void ExportMap()
{
try
{
MapInfo.Mapping.MapExport exportObject = new MapInfo.Mapping.MapExport (this.mapControl1.Map.Clone () as MapInfo.Mapping.Map);
exportObject.ExportSize = new MapInfo.Mapping.ExportSize (this.mapControl1.Map.Size.Width, this.mapControl1.Map.Size.Height);
exportObject.Format = MapInfo.Mapping.ExportFormat.Bmp; / / Save to the clipboard
System.Windows.Forms.Clipboard.SetDataObject (exportObject.Export ()); / / Save to your hard drive
exportObject.Export (@ "D: \ Image.bmp");
MessageBox.Show ("Save successful!");
}
catch (Exception ex)
{
throw ex;
}
}
I hope you have enjoyed this article based on save map image, export map as image in asp.net. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.
How to Save Map Image? - MapXtreme
Reviewed by Ravi Kumar
on
4:58 PM
Rating:
kya bat kya bat.....samajseva.....
ReplyDeletehahaha.. It's all for you guyz.. :)
ReplyDelete