google-site-verification=ECX1M6_Vb39ty4VtQDXQce6wOjmPTxSettd3hTIZb9Q

How to Save Map Image? - MapXtreme

random

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;
        }
    }
c# save image to file, save map,export, png, bmp,mapxtreme,save image, capture the image
.Png Image


Using Window App
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: 5

2 comments:

All Rights Reserved by Etechpulse © 2012 - 2017

Contact Form

Name

Email *

Message *

Powered by Blogger.