public void Export( ExportFormat exportFormat )
Public Sub Export( _ ByVal exportFormat As ExportFormat _ )
Parameters
- exportFormat
- ExportFormat
public void Export( ExportFormat exportFormat )
Public Sub Export( _ ByVal exportFormat As ExportFormat _ )
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
{
//Export a map frame to JPG.
string filePath = @"Path and file name for the output export file";
//Create JPEG format with appropriate settings
//BMP, EMF, EPS, GIF, PDF, PNG, SVG, TGA, and TFF formats are also available for export
JPEGFormat JPG = new JPEGFormat()
{
HasWorldFile = true,
Resolution = 300,
OutputFileName = filePath,
ColorMode = JPEGColorMode.TwentyFourBitTrueColor,
Height = 800,
Width = 1200
};
//Export on the worker thread
await QueuedTask.Run(() =>
{
//Reference the map frame
MapFrame mf = layout.FindElement("MyMapFrame") as MapFrame;
//Check to see if the path is valid and export
if (JPG.ValidateOutputFilePath())
{
mf.Export(JPG); //Export the map frame to JPG
}
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)