ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Presentations Namespace / MapPresentationPage Class / SetCamera Method / SetCamera(Camera) Method
Camera
Example

In This Topic
    SetCamera(Camera) Method
    In This Topic
    Sets the map page extent to a camera position. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void SetCamera( 
       Camera camera
    )
    Public Overloads Sub SetCamera( _
       ByVal camera As Camera _
    ) 

    Parameters

    camera
    Camera
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Change map page camera settings
    {
      await QueuedTask.Run(() =>
      {
        //Reference a map page
        var mpage = activePresentationView.Presentation.GetPage(4) as MapPresentationPage;
    
        //Set the map frame extent based on the new camera's X,Y, Scale and heading values
        Camera cam = new Camera(329997.6648, 6248553.1457, 2403605.8968, 24);
        mpage.SetCamera(cam);
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.5 or higher.
    See Also