Print Map

3 posts, 0 answers
  1. Aurelio Righetti
    Aurelio Righetti avatar
    51 posts
    Member since:
    May 2009

    Posted 05 Aug 2012 Link to this post

    Hi, i need to print the RadMap on a Paper with format A0 (big dimension), it's possibile ?
    Actually for print the map use the code on the post:
    it's work but the dimension of the map is the dimension on the screen resolution.

  2. Andrey
    Andrey avatar
    1681 posts

    Posted 08 Aug 2012 Link to this post

    Hello Aurelio,

    Using this approach you can't create image with pixel size more than original control has. But you can temporary increase size of the RadMap control, print it, and then restore original size. For example:

            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        <telerik:RadMap Name="radMap"
                <telerik:OpenStreetMapProvider />
            <telerik:InformationLayer Name="informationLayer">
        <StackPanel Grid.Column="1">
            <Button Click="ChangeSize">
                <TextBlock Text="Change size" />
            <Button Click="CopyToClipboard">
                <TextBlock Text="Copy To Clipboard" />
            <Button Click="RestoreSize">
                <TextBlock Text="Restore size" />

    private double originalWidth;
    private double originalHeight;
    private void ChangeSize(object sender, RoutedEventArgs e)
        originalWidth = this.radMap.Width;
        originalHeight = this.radMap.Height;
        this.radMap.Width = 2500;
        this.radMap.Height = 2500;
    private void ControlToClipboard(FrameworkElement obj)
        Transform transform = obj.LayoutTransform;
        obj.LayoutTransform = null;
        Thickness margin = obj.Margin;
        obj.Margin = new Thickness(0, 0, margin.Right - margin.Left,
            margin.Bottom - margin.Top);
        Size size = new Size(obj.ActualWidth, obj.ActualHeight);
        obj.Arrange(new Rect(size));
        RenderTargetBitmap bmp = new RenderTargetBitmap((int)obj.ActualWidth,
            (int)obj.ActualHeight, 96, 96, PixelFormats.Pbgra32);
        obj.LayoutTransform = transform;
        obj.Margin = margin;
    private void CopyToClipboard(object sender, RoutedEventArgs e)
    private void RestoreSize(object sender, RoutedEventArgs e)
        this.radMap.Width = originalWidth;
        this.radMap.Height = originalHeight;

    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Aurelio Righetti
    Aurelio Righetti avatar
    51 posts
    Member since:
    May 2009

    Posted 08 Aug 2012 Link to this post

    Hi..Andrey...thanks for the solution it's is Ok...

Back to Top