ArcObjects Library Reference

Create Simple Marker Symbol Snippet

Create a simple marker symbol by specifying and input color and marker style.

[C#]

///<summary>Create a simple marker symbol by specifying and input color and marker style.</summary>
///  
///<param name="rgbColor">An IRGBColor interface.</param>
///<param name="inputStyle">An esriSimpleMarkerStyle enumeration. Example: esriSMSCircle.</param>
///   
///<returns>An ISimpleMarkerSymbol interface.</returns>
///  
///<remarks></remarks>
public ESRI.ArcGIS.Display.ISimpleMarkerSymbol CreateSimpleMarkerSymbol(ESRI.ArcGIS.Display.IRgbColor rgbColor, ESRI.ArcGIS.Display.esriSimpleMarkerStyle inputStyle)
{
  if(rgbColor == null || inputStyle == null)
  {
    return null;
  }
  ESRI.ArcGIS.Display.ISimpleMarkerSymbol simpleMarkerSymbol = new ESRI.ArcGIS.Display.SimpleMarkerSymbolClass();
  simpleMarkerSymbol.Color = rgbColor;
  simpleMarkerSymbol.Style = inputStyle;

  return simpleMarkerSymbol;
}
[Visual Basic .NET]

'''<summary>Create a simple marker symbol by specifying and input color and marker style.</summary>
'''  
'''<param name="rgbColor">An IRGBColor interface.</param>
'''<param name="inputStyle">An esriSimpleMarkerStyle enumeration. Example: esriSMSCircle.</param>
'''   
'''<returns>An ISimpleMarkerSymbol interface.</returns>
'''  
'''<remarks></remarks>
Public Function CreateSimpleMarkerSymbol(ByVal rgbColor As ESRI.ArcGIS.Display.IRgbColor, ByVal inputStyle As ESRI.ArcGIS.Display.esriSimpleMarkerStyle) As ESRI.ArcGIS.Display.ISimpleMarkerSymbol

  If rgbColor Is Nothing OrElse inputStyle = Nothing Then
    Return Nothing
  End If

  Dim simpleMarkerSymbol As ESRI.ArcGIS.Display.ISimpleMarkerSymbol = New ESRI.ArcGIS.Display.SimpleMarkerSymbolClass
  simpleMarkerSymbol.Color = rgbColor
  simpleMarkerSymbol.Style = inputStyle

  Return simpleMarkerSymbol

End Function


Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.Display
  • ESRI.ArcGIS.System