This topic is relevant for the following:
Product(s): ArcGIS Desktop: All
Version(s): 9.0, 9.1, 9.2
Language(s): VB6, VC++
Experience level(s): Intermediate to advanced
The examples in this section show two different approaches to creating a custom symbol: inheriting from different abstract classes, and using different techniques to perform the drawing. These are, of course, only two examples. There is potential for innumerable different custom symbols.
You can create a custom fill symbol if required by implementing at least the ISymbol, IFillSymbol, and the persistence and cloning interfaces. You may also want to implement IMapLevel, IDisplayName, and IPropertySupport, if appropriate.
If using an external library to draw polygons in particular, pay proper attention to complex geometries, such as self-intersecting, donut, or multipart geometries. These types of geometries may result in unexpected effects when drawing, as the library (for example, Windows GDI functions) may define the structure of complex geometries in a different way than that used by ArcGIS geometries.
Text is complex to place accuratelyit is not expected that you will need to create custom TextSymbols. If you need to implement ITextSymbol, consider that your text should render correctly not just with basic appearance, but when drawing splined text, and text with different alignment, spacing, and so on. The display of right-to-left text should also be considered.
A custom ChartSymbol can be created and applied to the existing ChartRenderer by implementing ISymbol; IChartSymbol; IMarkerSymbol; and ISymbolArray; and, optionally, I3DChartSymbol, IMarkerBackgroundSupport, and IPropertySupport.
The integration, which can be achieved with the existing ChartRenderer object and its user interface components, is not as high as can be achieved by other custom symbols. The ChartRenderer and associated UI are both tightly integrated with the existing classes of chart symbol; the list of available ChartSymbols is predefined, not found in a component category. A custom ChartSymbol may be applied to an existing ChartRenderer programmatically and set up as required; however, if the layer symbology is then edited, the setup will not be reproducible or editable in the UI.
It is possible to improve the integration of the existing UI and your symbol by implementing one of the existing ChartSymbol interfaces: IBarChartSymbol, IPieChartSymbol, or IStackedChartSymbol. In this way you can 'piggyback' on the existing UI. Once set to a chart renderer, the existing UI can be used to alter the properties of your custom ChartSymbol via these existing interfacesimplement whichever has the properties closest to your requirements. The UI may not behave exactly as expected, as you are not providing exactly the symbol expected by the renderer.
Alternatively, you can create a custom renderer designed to apply your custom ChartSymbol. You may find it helps to contain an instance of an existing ChartRenderer to provide a framework for the new renderer. The disadvantage of this approach is the extra work you will need to do, particularly in providing the UI required to allow users to set up the renderer and in the renderer drawing code.
See Also Logo Marker Symbol Example, Vertex Line Symbol Example, and Creating custom symbols.