//Export the map view associated with a map frame to BMP.
//Create BMP format with appropriate settings
//EMF, EPS, GIF, JPEG, PDF, PNG, SVG, TGA, and TFF formats are also available for export
BMPFormat BMP = new BMPFormat()
{
Resolution = 300,
Height = 500,
Width = 800,
HasWorldFile = true,
OutputFileName = filePath
};
//Reference the active layout view
LayoutView lytView = LayoutView.Active;
//Reference the map frame and its map view
MapFrame mf_bmp = layout.FindElement("Map Frame") as MapFrame;
MapView mv_bmp = mf_bmp.GetMapView(lytView);
if (mv_bmp != null)
{
//Export on the worker thread
await QueuedTask.Run(() =>
{
//Check to see if the path is valid and export
if (BMP.ValidateOutputFilePath())
{
mv_bmp.Export(BMP); //Export to BMP
}
});
}