

Public Class CIMPictureGraphic Inherits CIMGraphic Implements System.ComponentModel.INotifyPropertyChanged, System.Xml.Serialization.IXmlSerializable
public class CIMPictureGraphic : CIMGraphic, System.ComponentModel.INotifyPropertyChanged, System.Xml.Serialization.IXmlSerializable
{
//Create a picture element and also set background and border symbology.
//Note: Must be on QueuedTask.Run
//Build 2D envelope geometry
Coordinate2D pic_ll = new Coordinate2D(6, 1);
Coordinate2D pic_ur = new Coordinate2D(8, 2);
Envelope env = EnvelopeBuilderEx.CreateEnvelope(pic_ll, pic_ur);
//Create and add element to layout
string picPath = @"C:\Temp\WhitePass.jpg";
GraphicElement picElm = ElementFactory.Instance.CreatePictureGraphicElement(
layout, env, picPath, "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);
}
{
// Use SourceURL for the URL to the image content. For
// a local file, use a file path. For a web/internet file
// location, use its URL
//
// Supported image types are:
// png, jpg, tiff, bmp, gif, svg
var pictureGraphic = new CIMPictureGraphic
{
SourceURL = @"C:\Images\MyImage.png",
Shape = envelope
};
IDisposable _graphic = mapView.AddOverlay(pictureGraphic);
}
System.Object
ArcGIS.Core.CIM.CIMObject
ArcGIS.Core.CIM.CIMGraphic
ArcGIS.Core.CIM.CIMPictureGraphic
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)