ArcGIS Pro 3.7 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 Sub ExportToImage( _
       ByVal fileName As String _
    ) 
    public void ExportToImage( 
       string fileName
    )

    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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.5 or higher.
    See Also