ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ElevationProfileGraph Class / ExportToImage Method
The file to export the elevation profile to
Example

In This Topic
    ExportToImage Method
    In This Topic
    Exports the current elevation profile to an image file.
    Syntax
    public void ExportToImage( 
       string fileName
    )
    Public Sub ExportToImage( _
       ByVal fileName As String _
    ) 

    Parameters

    fileName
    The file to export the elevation profile to
    Exceptions
    ExceptionDescription
    fileName cannot be null.
    The fileName does not have a .bmp, .jpg, .tif, .png extension.
    Example
    Export Elevation Profile Graph
    var elevProfileGraph = MapView.Active.GetElevationProfileGraph();
    // Elevation profile graph will be null if no profile graph is displayed
    if (elevProfileGraph == null)
      return;
    
    if (elevProfileGraph.CanExport)
    {
      elevProfileGraph.ExportToImage("c:\\temp\\myprofileImage.png");
      elevProfileGraph.ExportToCSV("c:\\temp\\myprofile.csv");
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.5 or higher.
    See Also