Creating custom elements


Summary
At times you may want to create a custom graphic element; for example, if you want to combine graphics and text, or draw a geometry that is unsupported (such as a triangle). This document outlines how to create your custom element.

In this topic


Creating a subtype of element

You can see from the following object model diagram (OMD) that the element coclasses are subtypes of the Element abstract class. Therefore, any custom element should implement a minimum of IElement, IElementProperties, IBoundsProperties, and ITransform2D. The IElementProperties2 interface can also be implemented for completeness, although this is not essential for an element to function.
In addition, elements should always implement IClone and either IPersist and IPersistStream or IPersistVariant depending on your development environment. You may also want to implement IPropertySupport, as this will increase compatibility with existing graphics tools. However, it is not mandatory and cannot be implemented in Visual Basic (VB).
Elements can be cloned and persisted and are stored in the document.

FrameElement or GraphicElement

In the following OMD, elements are split farther, with coclasses inheriting from the GraphicElement or FrameElement abstract classes. Your next design decision should be whether your custom element is a FrameElement or GraphicElement. See the following illustration:
Some elements, such as GroupElement and BMPPictureElement, implement both IFrameElement and IGraphicElement. They can appear as simple graphics that are drawn with a surrounding frame and placed on a page layout or in data view.
ArcGIS uses different kinds of elements. Some elements only appear in page layout view. GraphicElements can be added to a map and account for changes in the map's coordinate system. FrameElements have a surrounding neatline.

General design issues for a custom element

The following is a brief review of some design decisions you may need to make when creating a custom element:


See Also:

Creating different kinds of custom elements




Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine