ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / StyleItem Class / GenerateSymbolPreview Method
The symbol style item for which the preview image has to be created.
The highlight color to apply
The height of the preview image to be created.
The width of the preview image to be created.
Version

GenerateSymbolPreview Method
Creates a highlighted preview image for the symbol style item. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public static ImageSource GenerateSymbolPreview( 
   StyleItem styleItem,
   CIMColor highlightColor,
   int patchHeight,
   int patchWidth
)

Parameters

styleItem
The symbol style item for which the preview image has to be created.
highlightColor
The highlight color to apply
patchHeight
The height of the preview image to be created.
patchWidth
The width of the preview image to be created.

Return Value

The highlighted preview image for the style item.
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run
Unsupported style item type
Remarks
The provided highlight is applied to the patch in an identical fashion to how highlighting is applied on the map (for example: when a feature was selected).
Currently, only SymbolStyleItem is supported. Passing a style item other than SymbolStyleItem will throw a System.ArgumentException
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also