This document is archived and information here might be outdated.  Recommended version.


IDynamicGlyphFactory.CreateDynamicGlyph Method (ArcObjects .NET 10.7 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Display > ESRI.ArcGIS.Display > Interfaces > ID > IDynamicGlyphFactory Interface > IDynamicGlyphFactory.CreateDynamicGlyph Method
ArcGIS Developer Help

IDynamicGlyphFactory.CreateDynamicGlyph Method

Creates a dynamic glyph from a symbol.

[Visual Basic .NET]
Public Function CreateDynamicGlyph ( _
    ByVal Symbol As ISymbol _
) As IDynamicGlyph
[C#]
public IDynamicGlyph CreateDynamicGlyph (
    ISymbol Symbol
);
[C++]
HRESULT CreateDynamicGlyph(
  ISymbol* Symbol
);
[C++]
Parameters
Symbol [in]

Symbol is a parameter of type ISymbol*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

For monochromatic symbols (symbols that consist of only one color and might even have fixed black pixels), it is advisable to set the Symbol color to white before passing it into the method. When rendering the Dynamic Symbol, using the Dynamic Glyph created using this method, you should then set the color to the desired color. That will result in coloring the white pixels to the desired color, while leaving the black colors black.

[C#]

The following code shows how to create a dynamic glyph from a character marker symbol. It assumes that you already have valid DynamicGlyphFactory and DynamicGlyph objects.

// create character marker Symbol
ICharacterMarkerSymbol characterMarkerSymbol = new CharacterMarkerSymbolClass();
// set the symbol color to be white
characterMarkerSymbol.Color =  Converter.ToRGBColor(Color.FromArgb(255, 255, 255)) as IColor;
characterMarkerSymbol.Font = Converter.ToStdFont (new Font ("ESRI Environmental & Icons",32));
characterMarkerSymbol.Size = 40;
characterMarkerSymbol.Angle = 0;
characterMarkerSymbol.CharacterIndex = 36;
// create the glyph from the character marker symbol
m_markerGlyph = dynamicGlyphFactory.CreateDynamicGlyph(characterMarkerSymbol as ISymbol);

[Visual Basic .NET]

The following code shows how to create a dynamic glyph from a character marker symbol. It assumes that you already have valid DynamicGlyphFactory and DynamicGlyph objects.

' create character marker Symbol
Dim characterMarkerSymbol As ICharacterMarkerSymbol = New CharacterMarkerSymbolClass()
' set the symbol color to be white
characterMarkerSymbol.Color TryCast(Converter.ToRGBColor(color.FromArgb(255, 255, 255)), IColor)
characterMarkerSymbol.Font = Converter.ToStdFont(new Font("ESRI Environmental & Icons", 32))
characterMarkerSymbol.Size = 40
characterMarkerSymbol.Angle = 0
characterMarkerSymbol.CharacterIndex = 36
' create the glyph from the character marker symbol
m_markerGlyph =  dynamicGlyphFactory.CreateDynamicGlyph(TryCas(characterMarkerSymbol, ISymbol))

See Also

IDynamicGlyphFactory Interface

.NET Samples

Dynamic biking Dynamic display layer