Provides support for the filling and stroking of vectors with bitmap images.
The VectorImage class is used by Vector painting algorithms to fill and stroke vectors with bitmap images. This is achieved by initialising a VectorImage object with the desired settings and then registering it with a VectorScene via the VectorScene⇒AddDef() method.
Any vector within the target scene will be able to utilise the image for filling or stroking by referencing its name through the Vector⇒Fill and Vector⇒Stroke fields. For instance 'url(#logo)'.
It is strongly recommended that the VectorImage is owned by the VectorScene that is handling the definition. This will ensure that the VectorImage is de-allocated when the scene is destroyed.
NOTE: For the rendering of vectors as flattened images, use VectorPattern.
The VectorImage class consists of the following fields:
Access | Name | Type | Comment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AspectRatio | ARF | Flags that affect the aspect ratio of the image within its target vector. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defining an aspect ratio allows finer control over the position and scale of the image within its target vector.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bitmap | *Bitmap | Reference to a source bitmap for the rendering algorithm. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field must be set prior to initialisation. It will refer to a source bitmap that will be used by the rendering algorithm. The source bitmap must be in a 32-bit graphics format. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Dimensions | DMF | Dimension flags define whether individual dimension fields contain fixed or scaled values. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Of the Dimension flags that are available, only
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Picture | *Picture | Refers to a Picture from which the source Bitmap is acquired. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
SpreadMethod | VSPREAD | Defines image tiling behaviour, if desired. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The SpreadMethod defines the way in which the image is tiled within the target area if it is smaller than the available space. It is secondary to the application of AspectRatio. The default setting is
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Units | VUNIT | Declares the coordinate system to use for the X and Y values. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field declares the coordinate system that is used for values in the X and Y fields. The default is
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
X | DOUBLE | Apply a horizontal offset to the image, the origin of which is determined by the Units value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Y | DOUBLE | Apply a vertical offset to the image, the origin of which is determined by the Units value. |
Aspect ratios control alignment, scaling and clipping.
Name | Description |
---|---|
ARF::MEET | Aspect ratio is preserved. The entire viewbox will be visible in the viewport. The viewbox is scaled up as much as possible. |
ARF::NONE | Scale the viewbox to match the size of the viewport. Aspect ratio is not preserved. |
ARF::SLICE | Aspect ratio is preserved. The viewbox can extend beyond the viewport's edges on one axis. The viewbox is scaled up as much as possible. |
ARF::X_MAX | Align to the right. |
ARF::X_MID | Align to the horizontal center. |
ARF::X_MIN | Align to the left. |
ARF::Y_MAX | Align to the bottom. |
ARF::Y_MID | Align to the vertical center. |
ARF::Y_MIN | Align to the top. |
Name | Description |
---|---|
DMF::FIXED_CENTER_X | The CenterX field is a fixed size. |
DMF::FIXED_CENTER_Y | The CenterY field is a fixed size. |
DMF::FIXED_DEPTH | The Depth field is a fixed size. |
DMF::FIXED_HEIGHT | The Height field is a fixed size. |
DMF::FIXED_RADIUS_X | The RadiusX field is a fixed size. |
DMF::FIXED_RADIUS_Y | The RadiusY field is a fixed size. |
DMF::FIXED_WIDTH | The Width field is a fixed suze. |
DMF::FIXED_X | The X field is a fixed coordinate. |
DMF::FIXED_X_OFFSET | The XOffset field is a fixed coordinate. |
DMF::FIXED_Y | The Y field is a fixed coordinate. |
DMF::FIXED_Y_OFFSET | The YOffset field is a fixed coordinate. |
DMF::FIXED_Z | The Z field is a fixed coordinate. |
DMF::SCALED_CENTER_X | The CenterX field is scaled to this object's parent. |
DMF::SCALED_CENTER_Y | The CenterY field is scaled to this object's parent. |
DMF::SCALED_DEPTH | The Depth field is scaled to this object's parent. |
DMF::SCALED_HEIGHT | The Height field is scaled to this object's parent. |
DMF::SCALED_RADIUS_X | The RadiusX field is scaled to this object's parent. |
DMF::SCALED_RADIUS_Y | The RadiusY field is a scaled size to this object's parent. |
DMF::SCALED_WIDTH | The Width field is scaled to this object's parent. |
DMF::SCALED_X | The X field is scaled to this object's parent. |
DMF::SCALED_X_OFFSET | The XOffset field is scaled to this object's parent. |
DMF::SCALED_Y | The Y field is scaled to this object's parent. |
DMF::SCALED_Y_OFFSET | The YOffset field is scaled to this object's parent. |
DMF::SCALED_Z | The Z field is a scaled coordinate to this object's parent. |
DMF::STATUS_CHANGE_H | |
DMF::STATUS_CHANGE_V |
Spread method options define the method to use for tiling filled graphics.
Name | Description |
---|---|
VSPREAD::CLIP | Do not scale the graphic. Clip it if it extends past imposed boundaries. |
VSPREAD::PAD | Scale the graphic to the object bounds. |
VSPREAD::REFLECT | Tile the graphic, reflecting the image alternately on the X and Y axis. |
VSPREAD::REFLECT_X | Tile the graphic, reflecting the image alternately on the X axis only. |
VSPREAD::REFLECT_Y | Tile the graphic, reflecting the image alternately on the Y axis only. |
VSPREAD::REPEAT | Tile the graphic repeatedly. |
VSPREAD::UNDEFINED | Either the default setting will be applied or the setting will be inherited from a parent object. |
Name | Description |
---|---|
VUNIT::BOUNDING_BOX | Coordinates are scaled to the object's bounding box. |
VUNIT::UNDEFINED | Either the default setting will be applied or the setting will be inherited from a parent object. |
VUNIT::USERSPACE | Coordinates are scaled to the current viewport. |
Class Info | |
---|---|
ID | ID_VECTORIMAGE |
Category | Graphics |
Include | modules/vectorimage.h |
Version | 1 |