ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / SymbolFactory Class / ConstructMarkerFromStream Method
The stream representing the image.
Example

In This Topic
    ConstructMarkerFromStream Method (SymbolFactory)
    In This Topic
    Constructs a marker from a stream.
    Syntax
    Public Function ConstructMarkerFromStream( _
       ByVal stream As Stream _
    ) As CIMMarker
    public CIMMarker ConstructMarkerFromStream( 
       Stream stream
    )

    Parameters

    stream
    The stream representing the image.

    Return Value

    Remarks
    Marker can be created from the following stream data type: JPG, BMP, PNG, GIF
    Example
    How to construct a point symbol from a in memory graphic
    {
        //Create a stream for the image
        //At 3.0 you need https://www.nuget.org/packages/Microsoft.Windows.Compatibility
        //System.Drawing
        System.Drawing.Image newImage = System.Drawing.Image.FromFile(@"C:\PathToImage\Image.png");
        var stream = new System.IO.MemoryStream();
        newImage.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
        stream.Position = 0;
        //Create marker using the stream
        CIMMarker markerFromStream = SymbolFactory.Instance.ConstructMarkerFromStream(stream);
        //Create the point symbol from the marker
        CIMPointSymbol pointSymbolFromStream = SymbolFactory.Instance.ConstructPointSymbol(markerFromStream);
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also