How to Save Map into Image File

2 posts, 0 answers
  1. LaDonna
    LaDonna  avatar
    8 posts
    Member since:
    Jul 2010

    Posted 13 Jun 2011 Link to this post

    How can we save the current view of the map into an image file?  We use the EmptyProvider with shape files and no complex backgrounds/querying for map data providers.
  2. Andrey
    Andrey avatar
    1681 posts

    Posted 16 Jun 2011 Link to this post

    Hello LaDonna ,

    You can save the contents of the information layer to an image file using ExportExtensions.ExportToImage method.
    The sample code is below.
    private void SaveToImage() 
        SaveFileDialog dialog = new SaveFileDialog(); 
        dialog.Filter = "Png (*.png)|*.png"
        bool? dialogResult = dialog.ShowDialog(); 
        if (dialogResult == true
            using (Stream stream = dialog.OpenFile()) 
                    this.informationLayer, stream, new Telerik.Windows.Media.Imaging.PngBitmapEncoder()); 

    Best wishes,
    Andrey Murzov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top