MapPrintSizeMode Enum
Lists the values specifying size modes used when a map is printed or exported.
Namespace: DevExpress.Xpf.Map
Assembly: DevExpress.Xpf.Map.v18.2.dll
Declaration
Members
Name | Description |
---|---|
Normal
|
A map is printed in the identical size it appears on the form. |
Zoom
|
A map is resized proportionally (without clipping), so that it best fits the page on which it is printed. |
Stretch
|
A map is stretched or shrunk to fit the page on which it is printed. |
Related API Members
The following properties accept/return MapPrintSizeMode values:
Remarks
The values listed by this enumeration are used to set MapPrintOptions.SizeMode of the instance stored in the MapControl.PrintOptions property. These options are used by printing (MapControl.ShowPrintPreview, MapControl.ShowPrintPreviewDialog,MapControl.ShowRibbonPrintPreview, MapControl.ShowRibbonPrintPreviewDialog) and exporting methods (MapControl.ExportToHtml, MapControl.ExportToImage, MapControl.ExportToMht, MapControl.ExportToPdf, MapControl.ExportToRtf, MapControl.ExportToXls, MapControl.ExportToXlsx, MapControl.ExportToXps).
Example
To print a map, use one of the following methods.
- MapControl.ShowRibbonPrintPreview - invokes the Print Preview Form with the Ribbon bar;
- MapControl.ShowRibbonPrintPreviewDialog - invokes the modal Print Preview Form with the Ribbon bar;
- MapControl.ShowPrintPreview - invokes the Print Preview Form;
- MapControl.ShowPrintPreviewDialog - invokes the modal Print Preview Form;
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-print-a-map-t200441.
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:local="clr-namespace:PrintingExporting"
x:Class="PrintingExporting.MainWindow"
Title="MainWindow" Height="600" Width="800">
<Window.Resources>
<ObjectDataProvider x:Key="PrintSizeValues" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="dxm:MapPrintSizeMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="PrintMethodValues" MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:PrintMetod"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</Window.Resources>
<Grid>
<dxlc:LayoutControl>
<dxlc:LayoutGroup Orientation="Vertical">
<dxlc:LayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<dxm:MapControl Name="mapControl">
<dxm:MapControl.PrintOptions>
<dxm:MapPrintOptions SizeMode="{Binding SelectedItem, ElementName=cbPrintingSize}"/>
</dxm:MapControl.PrintOptions>
<dxm:ImageTilesLayer>
<dxm:ImageTilesLayer.DataProvider>
<dxm:BingMapDataProvider BingKey="Your Bing Key"/>
</dxm:ImageTilesLayer.DataProvider>
</dxm:ImageTilesLayer>
</dxm:MapControl>
</dxlc:LayoutItem>
<dxlc:LayoutGroup>
<dxlc:LayoutItem Label="Printing Size" AddColonToLabel="True">
<ComboBox x:Name="cbPrintingSize" SelectedIndex="0"
ItemsSource="{Binding Source={StaticResource PrintSizeValues}}"/>
</dxlc:LayoutItem>
<dxlc:LayoutItem Label="Print Method" AddColonToLabel="True">
<ComboBox x:Name="cbPrintingMethod" SelectedIndex="0"
ItemsSource="{Binding Source={StaticResource PrintMethodValues}}"/>
</dxlc:LayoutItem>
<dxlc:LayoutItem Width="100">
<Button Content="Print" Click="Button_Click"/>
</dxlc:LayoutItem>
</dxlc:LayoutGroup>
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
</Grid>
</Window>
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the MapPrintSizeMode enum.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.