2D Graphics attributes and bundles classes provide primitive attributes, such as paint, pen, and image transfer mode. It also provides IGrafBundle which is the collection class for combinations of these primitive attributes used to render a 2D graphic geometry. Attributes and bundles classes are mainly used for assigning and collecting attributes for 2D graphics.
Attributes are the characteristics that describe how geometries are rendered. In a graphics system, you cannot render geometry without specifying the attributes because the system has no information about how to display the geometry. You can set the attributes for a rendering device without actually rendering any geometry. You can represent that set by a collection of attribute values. IAttributeState and its subclasses are designed to fill this role.
The number of attributes required by an application depends on the purpose. The 2D Graphics Framework provides a mechanism, a bundle, to collect attributes together for rendering. The IGrafBundle class collects together all attributes needed to render a geometry.
A graphic object can have an IGrafBundle or another subclass of IAttributeState. The 2D Graphics Framework provides some commonly used IAttributeState classes.
| Attribute | Description |
|---|---|
| Drawing operations | Determine whether the attribute bundle is for fill, frame, or fill and frame. |
| Paints | Fill paint: Specifies the
color of the fill for a 2D graphic. Frame paint: Specifies the color of the frame for a 2D graphic. Fill and frame paint: Specifies the color and pattern of the fill or frame for a 2D graphic. |
| Transfer modes | Fill transfer modes: (All 2D
graphics drawn into a 2D image.) Provides algorithms to
determine the color of a fill pixel when a 2D graphic
fill pixel of one color overlays a 2D graphic or image
pixel of another color. Frame transfer modes: (All 2D graphics drawn into a 2D image.) Provides algorithms to determine the color of a frame pixel when a 2D graphic frame pixel of one color overlays a 2D graphic or image pixel of another color. Image transfer modes: (2D images only.) Provides algorithms to determine the color of a 2D image pixel when a pixel of one color overlays a pixel of another color. |
| Frame styles | Pen styles: Specifies the
pattern of the frame. Cap styles: Assigns a flush, square, or round shape that is added to the start or end of the frame for a line geometry to create a finished effect. Joint styles: Assigns a filler for the gap that is created in the frame by a sharp joint in a curve, using the standard bevel, round, and mitre frame joints. |
| Image sampling | Provides algorithms for sampling an image prior to drawing when it has been enlarged (enlarging the pixel information) or shrunk (compressing the pixel information). Algorithms make tradeoffs between quality and drawing speed. |
![]()