ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / PictureElement Class / SetSourcePath Method
String
Example

In This Topic
    SetSourcePath Method
    In This Topic
    Regenerates the picture using the new file path to a picture on disk. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub SetSourcePath( _
       ByVal URI As String _
    ) 
    public void SetSourcePath( 
       string URI
    )

    Parameters

    URI
    String
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Update a picture element
    {
      //Update a picture element.
      //Note: Must be on QueuedTask.Run
    
      // Reference a picture element by name
      PictureElement picElm = layout.FindElement("MyPicture") as PictureElement;
      // Change the path to a new source
      picElm?.SetSourcePath(@"D:\MyData\Pics\somePic.jpg");
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also