ArcGIS Pro 2.9 API Reference Guide
PictureElement Class
Members  Example 

ArcGIS.Desktop.Layouts Namespace : PictureElement Class
Represents a picture element on a page layout.
Object Model
PictureElement ClassGraphicElement ClassCoordinate2D StructureEnvelope ClassCIMElement ClassCIMGraphic ClassIElementParent Interface
Syntax
Remarks
A PictureElement is a type of GraphicElement and therefore can be positioned or resized on the page. Picture elements are embedded in the project file (.aprx) but the SourcePath property will return the original source file source path. You can change the picture by using the SetSourcePath method along with a new file path.
Example
The examples below demonstrate how to work with picture elements. SetSourcePath method.
///This example references a PictureElement on a layout and changes the picture by setting a path to a file on disk using the

//Added references
using ArcGIS.Desktop.Core;                        
using ArcGIS.Desktop.Layouts;                      
using ArcGIS.Desktop.Framework.Threading.Tasks;    

public class PictureElementExample
{
  public static Task<bool> UpdatePictureElementAsync(string LayoutName, string PictureName, string PicturePath)
  {
    //Reference a layoutitem in a project by name
    LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(LayoutName));
    if (layoutItem == null)
      return Task.FromResult(false);

    return QueuedTask.Run<bool>(() =>
    {
            //Reference and load the layout associated with the layout item
            Layout lyt = layoutItem.GetLayout();

            //Reference a picture element by name
            PictureElement picElm = lyt.FindElement(PictureName) as PictureElement;
      if (picElm == null)
        return false;

            //Change the path to a new source
            picElm.SetSourcePath(PicturePath);

      return true;
    });
  }
}
//Create a picture element and also set background and border symbology.

//Construct on the worker thread
await QueuedTask.Run(() =>
{
  //Build 2D envelope geometry
  Coordinate2D pic_ll = new Coordinate2D(6, 1);
  Coordinate2D pic_ur = new Coordinate2D(8, 2);
  Envelope env = EnvelopeBuilder.CreateEnvelope(pic_ll, pic_ur);

  //Create and add element to layout
  string picPath = @"C:\Temp\WhitePass.jpg";
  GraphicElement picElm = LayoutElementFactory.Instance.CreatePictureGraphicElement(layout, env, picPath);
  picElm.SetName("New Picture");

  //(Optionally) Modify the border and shadow 
  CIMGraphic picGra = picElm.GetGraphic();
  CIMPictureGraphic cimPicGra = picGra as CIMPictureGraphic;
  cimPicGra.Frame.BorderSymbol = new CIMSymbolReference();
  cimPicGra.Frame.BorderSymbol.Symbol = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.BlueRGB, 2.0, SimpleLineStyle.Solid);

  cimPicGra.Frame.ShadowSymbol = new CIMSymbolReference();
  cimPicGra.Frame.ShadowSymbol.Symbol = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.BlackRGB, SimpleFillStyle.Solid);

  //Update the element
  picElm.SetGraphic(picGra);
});
Inheritance Hierarchy

System.Object
   ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
      ArcGIS.Desktop.Layouts.Element
         ArcGIS.Desktop.Layouts.GraphicElement
            ArcGIS.Desktop.Layouts.PictureElement

Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

PictureElement Members
ArcGIS.Desktop.Layouts Namespace