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

Export map image

1 Answer 70 Views
Map
This is a migrated thread and some comments may be shown as answers.
Hongyi
Top achievements
Rank 1
Hongyi asked on 06 Dec 2013, 12:24 PM
Hi everyone,
I can export the whole map image file now using the code below.
using (Stream stream = dialog.OpenFile())
{
    FrameworkElement element = this.m_Radmap.FindChildByType<ItemsPresenter>();
    Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(
        element, stream, new PngBitmapEncoder());
}

But the problem is that I have added a few marks on radmap information layer.
How to export these marks together with the map image?

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 11 Dec 2013, 08:56 AM
Hello Hongyi,

We noticed that you're exporting the ItemsPresentr within the RadMap and if you'd rather export only the Map content and its InformationLayer, then I'd suggest hiding elements like map navigation, map scale etc.

You can hide them before export using the following code:

this.m_Radmap.NavigationVisibility = System.Windows.Visibility.Collapsed;
this.m_Radmap.CommandBarVisibility = System.Windows.Visibility.Collapsed;
this.m_Radmap.ZoomBarVisibility = System.Windows.Visibility.Collapsed;
this.m_Radmap.ScaleVisibility = System.Windows.Visibility.Collapsed;
this.m_Radmap.MouseLocationIndicatorVisibility = System.Windows.Visibility.Collapsed;
this.m_Radmap.MiniMapExpanderVisibility = System.Windows.Visibility.Collapsed;
using (Stream stream = dialog.OpenFile())
{
    ExportExtensions.ExportToImage(
        this.m_Radmap, stream, new PngBitmapEncoder());
}
 
this.m_Radmap.NavigationVisibility = System.Windows.Visibility.Visible;
this.m_Radmap.CommandBarVisibility = System.Windows.Visibility.Visible;
this.m_Radmap.ZoomBarVisibility = System.Windows.Visibility.Visible;
this.m_Radmap.ScaleVisibility = System.Windows.Visibility.Visible;
this.m_Radmap.MouseLocationIndicatorVisibility = System.Windows.Visibility.Visible;
this.m_Radmap.MiniMapExpanderVisibility = System.Windows.Visibility.Visible;

Please let me know if that helps or if we can further assist you.

Regards,

Andrey Murzov

Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.

Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.

Sign up for Free application insights >>


Tags
Map
Asked by
Hongyi
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or