Map layer export: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
== Simple export == | == Simple export == | ||
To use the simple export, the entry point is [http://docs.maria.teleplanglobe.com/codedoc/html/1919A26D.htm MariaRasterExport]. This export is designed for maximum ease of use thus does not give many options for tweaking the output. It also means that a [http:// | To use the simple export, the entry point is [http://docs.maria.teleplanglobe.com/codedoc/html/1919A26D.htm MariaRasterExport]. This export is designed for maximum ease of use thus does not give many options for tweaking the output. It also means that a [http://codedoc.maria.teleplanglobe.com/codedoc/html/C471C835.htm MariaUserControl] has to have been created already. | ||
The export will have the same size as the layers are set up with. The dpi will also be regular screen dpi. | The export will have the same size as the layers are set up with. The dpi will also be regular screen dpi. | ||
== Offscreen export == | == Offscreen export == | ||
The offscreen export mode requires the user to set up the layers that are to be exported using data classes provided by Maria GDK. The entry point for this is [http:// | The offscreen export mode requires the user to set up the layers that are to be exported using data classes provided by Maria GDK. The entry point for this is [http://codedoc.maria.teleplanglobe.com/codedoc/html/BD147A88.htm OffscreenRasterExportFactory] from which you can get the actual [http://codedoc.maria.teleplanglobe.com/codedoc/html/8998F8D0.htm IOffscreenRasterExporter] implementation that provides the api for adding layers to export. | ||
The export process itself is asynchroneous and reports its progress using events. | The export process itself is asynchroneous and reports its progress using events. | ||
When the export has finished you can retrieve the actual exported bitmap using the property [http:// | When the export has finished you can retrieve the actual exported bitmap using the property [http://codedoc.maria.teleplanglobe.com/codedoc/html/5B9CFE12.htm ExportedImage] | ||
== Complex export == | == Complex export == | ||
The complex export functionality is similar to the [[#Offscreen export]] in that the layers to export has to be set up manually. The entry point is [http:// | The complex export functionality is similar to the [[#Offscreen export]] in that the layers to export has to be set up manually. The entry point is [http://codedoc.maria.teleplanglobe.com/codedoc/html/BD147A88.htm OffscreenRasterExportFactory] that will provide a [http://codedoc.maria.teleplanglobe.com/codedoc/html/F758CA1F.htm IComplexOffScreenExporter] implementation. This interface provides the property [http://codedoc.maria.teleplanglobe.com/codedoc/html/F1216240.htm OffScreenRasterExporter] that should be used for setting up the layers to export. | ||
The difference between [[#Offscreen export]] and the the complex export is the fact that the former results in a bitmap, while the latter has a intermediate step where a [http:// | The difference between [[#Offscreen export]] and the the complex export is the fact that the former results in a bitmap, while the latter has a intermediate step where a [http://codedoc.maria.teleplanglobe.com/codedoc/html/99239F02.htm ExportCanvas] is provided. This class exposes functionality to add visual elements at predetermined places. Apart from that, the ExportCanvas inherits WPF Canvas, and can as such be used in just the same way in order to customize the output in flexible manner. | ||
When the canvas has all the desired elements use [http:// | When the canvas has all the desired elements use [http://codedoc.maria.teleplanglobe.com/codedoc/html/706CF985.htm FinalizeExport] method of the ExportCanvas class to get the final bitmap. This method will create the bitmap taking into account dpi and all other factors to create a correct bitmap. |
Revision as of 13:07, 9 March 2020
The export functionality of Maria GDK provides a way to get a bitmap export of a Maria layer stack. There are three different ways of achieving this depending on the level of control that is desired. Each of these ways will be described on this page.
Simple export
To use the simple export, the entry point is MariaRasterExport. This export is designed for maximum ease of use thus does not give many options for tweaking the output. It also means that a MariaUserControl has to have been created already.
The export will have the same size as the layers are set up with. The dpi will also be regular screen dpi.
Offscreen export
The offscreen export mode requires the user to set up the layers that are to be exported using data classes provided by Maria GDK. The entry point for this is OffscreenRasterExportFactory from which you can get the actual IOffscreenRasterExporter implementation that provides the api for adding layers to export.
The export process itself is asynchroneous and reports its progress using events.
When the export has finished you can retrieve the actual exported bitmap using the property ExportedImage
Complex export
The complex export functionality is similar to the #Offscreen export in that the layers to export has to be set up manually. The entry point is OffscreenRasterExportFactory that will provide a IComplexOffScreenExporter implementation. This interface provides the property OffScreenRasterExporter that should be used for setting up the layers to export.
The difference between #Offscreen export and the the complex export is the fact that the former results in a bitmap, while the latter has a intermediate step where a ExportCanvas is provided. This class exposes functionality to add visual elements at predetermined places. Apart from that, the ExportCanvas inherits WPF Canvas, and can as such be used in just the same way in order to customize the output in flexible manner.
When the canvas has all the desired elements use FinalizeExport method of the ExportCanvas class to get the final bitmap. This method will create the bitmap taking into account dpi and all other factors to create a correct bitmap.