Export map image

2 posts, 0 answers
  1. Hongyi
    Hongyi avatar
    1 posts
    Member since:
    Dec 2013

    Posted 06 Dec 2013 Link to this post

    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?
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 11 Dec 2013 Link to this post

    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 >>


  3. UI for WPF is Visual Studio 2017 Ready
Back to Top