ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / JPEGFormat Class
Members Example

In This Topic
    JPEGFormat Class
    In This Topic
    Represents a Joint Photographic Experts Group (JPEG) format object that can be used to export a MapView, MapFrame, or a Layout.
    Syntax
    public class JPEGFormat : ExportFormat 
    Public Class JPEGFormat 
       Inherits ExportFormat
    Remarks
    JPEG files are compressed image files. They support 24-bit color and are a popular choice for use on the web because a JPEG file size is often substantially smaller than many other image formats. However, the JPEG compression algorithm is lossy and is not recommended for many map images, as line drawings, and text or icon graphics become blurred by compression artifacts. Therefore, PNG is usually a superior format for map images. JPEGs can be generated with an accompanying world file for use as georeferenced raster data.
    Example
    Export a map frame to JPG
    {
      //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
        }
      });
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Mapping.ExportFormat
          ArcGIS.Desktop.Mapping.JPEGFormat

    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also