Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
    • Audio
    • Sound
    • File
    • MetaClass
    • Module
    • StorageDevice
    • Task
    • Thread
    • Time
    • Compression
    • Config
    • Script
    • XML
    • Controller
    • BlurFX
    • ColourFX
    • CompositeFX
    • ConvolveFX
    • DisplacementFX
    • FilterEffect
    • FloodFX
    • ImageFX
    • LightingFX
    • MergeFX
    • MorphologyFX
    • OffsetFX
    • RemapFX
    • SourceFX
    • TurbulenceFX
    • WaveFunctionFX
    • Scintilla
    • ScintillaSearch
    • Bitmap
    • Clipboard
    • Display
    • Document
    • Font
    • Picture
    • Pointer
    • Surface
    • SVG
    • ClientSocket
    • HTTP
    • NetSocket
    • Proxy
    • Vector
    • VectorClip
    • VectorColour
    • VectorEllipse
    • VectorFilter
    • VectorGradient
    • VectorGroup
    • VectorImage
    • VectorPath
    • VectorPattern
    • VectorPolygon
    • VectorRectangle
    • VectorScene
    • VectorShape
    • VectorSpiral
    • VectorText
    • VectorTransition
    • VectorViewport
    • VectorWave

VectorImage Class

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.

Structure

The VectorImage class consists of the following fields:

Access
NameTypeComment
  AspectRatioARFFlags 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.

NameDescription
ARF::MEETAspect ratio is preserved. The entire viewbox will be visible in the viewport. The viewbox is scaled up as much as possible.
ARF::NONEScale the viewbox to match the size of the viewport. Aspect ratio is not preserved.
ARF::SLICEAspect 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_MAXAlign to the right.
ARF::X_MIDAlign to the horizontal center.
ARF::X_MINAlign to the left.
ARF::Y_MAXAlign to the bottom.
ARF::Y_MIDAlign to the vertical center.
ARF::Y_MINAlign to the top.
  Bitmap*BitmapReference 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.

  DimensionsDMFDimension flags define whether individual dimension fields contain fixed or scaled values.

Of the Dimension flags that are available, only FIXED_X, FIXED_Y, SCALED_X and SCALED_Y are applicable.

NameDescription
DMF::FIXED_CENTER_XThe CenterX field is a fixed size.
DMF::FIXED_CENTER_YThe CenterY field is a fixed size.
DMF::FIXED_DEPTHThe Depth field is a fixed size.
DMF::FIXED_HEIGHTThe Height field is a fixed size.
DMF::FIXED_RADIUS_XThe RadiusX field is a fixed size.
DMF::FIXED_RADIUS_YThe RadiusY field is a fixed size.
DMF::FIXED_WIDTHThe Width field is a fixed suze.
DMF::FIXED_XThe X field is a fixed coordinate.
DMF::FIXED_X_OFFSETThe XOffset field is a fixed coordinate.
DMF::FIXED_YThe Y field is a fixed coordinate.
DMF::FIXED_Y_OFFSETThe YOffset field is a fixed coordinate.
DMF::FIXED_ZThe Z field is a fixed coordinate.
DMF::SCALED_CENTER_XThe CenterX field is scaled to this object's parent.
DMF::SCALED_CENTER_YThe CenterY field is scaled to this object's parent.
DMF::SCALED_DEPTHThe Depth field is scaled to this object's parent.
DMF::SCALED_HEIGHTThe Height field is scaled to this object's parent.
DMF::SCALED_RADIUS_XThe RadiusX field is scaled to this object's parent.
DMF::SCALED_RADIUS_YThe RadiusY field is a scaled size to this object's parent.
DMF::SCALED_WIDTHThe Width field is scaled to this object's parent.
DMF::SCALED_XThe X field is scaled to this object's parent.
DMF::SCALED_X_OFFSETThe XOffset field is scaled to this object's parent.
DMF::SCALED_YThe Y field is scaled to this object's parent.
DMF::SCALED_Y_OFFSETThe YOffset field is scaled to this object's parent.
DMF::SCALED_ZThe Z field is a scaled coordinate to this object's parent.
DMF::STATUS_CHANGE_H
DMF::STATUS_CHANGE_V
  Picture*PictureRefers to a Picture from which the source Bitmap is acquired.

If an image bitmap is sourced from a Picture then this field may be used to refer to the Picture object. The picture will not be used directly by the VectorImage, as only the bitmap is of interest.

The picture bitmap must be in a 32-bit graphics format.

  SpreadMethodVSPREADDefines 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 CLIP, which prevents the image from being tiled.

NameDescription
VSPREAD::CLIPDo not scale the graphic. Clip it if it extends past imposed boundaries.
VSPREAD::PADScale the graphic to the object bounds.
VSPREAD::REFLECTTile the graphic, reflecting the image alternately on the X and Y axis.
VSPREAD::REFLECT_XTile the graphic, reflecting the image alternately on the X axis only.
VSPREAD::REFLECT_YTile the graphic, reflecting the image alternately on the Y axis only.
VSPREAD::REPEATTile the graphic repeatedly.
VSPREAD::UNDEFINEDEither the default setting will be applied or the setting will be inherited from a parent object.
  UnitsVUNITDeclares 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 BOUNDING_BOX.

NameDescription
VUNIT::BOUNDING_BOXCoordinates are scaled to the object's bounding box.
VUNIT::UNDEFINEDEither the default setting will be applied or the setting will be inherited from a parent object.
VUNIT::USERSPACECoordinates are scaled to the current viewport.
  XDOUBLEApply a horizontal offset to the image, the origin of which is determined by the Units value.
  YDOUBLEApply a vertical offset to the image, the origin of which is determined by the Units value.
VectorImage class documentation © Paul Manias © 2010-2025

ARF Type

Aspect ratios control alignment, scaling and clipping.

NameDescription
ARF::MEETAspect ratio is preserved. The entire viewbox will be visible in the viewport. The viewbox is scaled up as much as possible.
ARF::NONEScale the viewbox to match the size of the viewport. Aspect ratio is not preserved.
ARF::SLICEAspect 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_MAXAlign to the right.
ARF::X_MIDAlign to the horizontal center.
ARF::X_MINAlign to the left.
ARF::Y_MAXAlign to the bottom.
ARF::Y_MIDAlign to the vertical center.
ARF::Y_MINAlign to the top.
VectorImage module documentation © Paul Manias © 2010-2025

DMF Type

NameDescription
DMF::FIXED_CENTER_XThe CenterX field is a fixed size.
DMF::FIXED_CENTER_YThe CenterY field is a fixed size.
DMF::FIXED_DEPTHThe Depth field is a fixed size.
DMF::FIXED_HEIGHTThe Height field is a fixed size.
DMF::FIXED_RADIUS_XThe RadiusX field is a fixed size.
DMF::FIXED_RADIUS_YThe RadiusY field is a fixed size.
DMF::FIXED_WIDTHThe Width field is a fixed suze.
DMF::FIXED_XThe X field is a fixed coordinate.
DMF::FIXED_X_OFFSETThe XOffset field is a fixed coordinate.
DMF::FIXED_YThe Y field is a fixed coordinate.
DMF::FIXED_Y_OFFSETThe YOffset field is a fixed coordinate.
DMF::FIXED_ZThe Z field is a fixed coordinate.
DMF::SCALED_CENTER_XThe CenterX field is scaled to this object's parent.
DMF::SCALED_CENTER_YThe CenterY field is scaled to this object's parent.
DMF::SCALED_DEPTHThe Depth field is scaled to this object's parent.
DMF::SCALED_HEIGHTThe Height field is scaled to this object's parent.
DMF::SCALED_RADIUS_XThe RadiusX field is scaled to this object's parent.
DMF::SCALED_RADIUS_YThe RadiusY field is a scaled size to this object's parent.
DMF::SCALED_WIDTHThe Width field is scaled to this object's parent.
DMF::SCALED_XThe X field is scaled to this object's parent.
DMF::SCALED_X_OFFSETThe XOffset field is scaled to this object's parent.
DMF::SCALED_YThe Y field is scaled to this object's parent.
DMF::SCALED_Y_OFFSETThe YOffset field is scaled to this object's parent.
DMF::SCALED_ZThe Z field is a scaled coordinate to this object's parent.
DMF::STATUS_CHANGE_H
DMF::STATUS_CHANGE_V
VectorImage module documentation © Paul Manias © 2010-2025

VSPREAD Type

Spread method options define the method to use for tiling filled graphics.

NameDescription
VSPREAD::CLIPDo not scale the graphic. Clip it if it extends past imposed boundaries.
VSPREAD::PADScale the graphic to the object bounds.
VSPREAD::REFLECTTile the graphic, reflecting the image alternately on the X and Y axis.
VSPREAD::REFLECT_XTile the graphic, reflecting the image alternately on the X axis only.
VSPREAD::REFLECT_YTile the graphic, reflecting the image alternately on the Y axis only.
VSPREAD::REPEATTile the graphic repeatedly.
VSPREAD::UNDEFINEDEither the default setting will be applied or the setting will be inherited from a parent object.
VectorImage module documentation © Paul Manias © 2010-2025

VUNIT Type

NameDescription
VUNIT::BOUNDING_BOXCoordinates are scaled to the object's bounding box.
VUNIT::UNDEFINEDEither the default setting will be applied or the setting will be inherited from a parent object.
VUNIT::USERSPACECoordinates are scaled to the current viewport.
VectorImage module documentation © Paul Manias © 2010-2025