This is a migrated thread and some comments may be shown as answers.

How to Save Map into Image File

1 Answer 85 Views
Map
This is a migrated thread and some comments may be shown as answers.
LaDonna
Top achievements
Rank 1
LaDonna asked on 13 Jun 2011, 09:03 PM
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.

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 16 Jun 2011, 11:33 AM
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()) 
        
            Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage( 
                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
Tags
Map
Asked by
LaDonna
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or