Kōtuku
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Config
    • Core
    • Display
    • Document
    • Font
    • HTTP
    • Network
    • Regex
    • SVG
    • Tiri
    • Vector
    • XML
    • XQuery
    • XRandR
      • Audio
      • MP3
      • Sound
      • File
      • MetaClass
      • Module
      • StorageDevice
      • Task
      • Thread
      • Time
      • Compression
      • CompressedStream
      • Config
      • LZMAStream
      • Script
      • Tiri
      • XML
      • XQuery
      • Controller
      • BlurFX
      • ColourFX
      • CompositeFX
      • ConvolveFX
      • DisplacementFX
      • FilterEffect
      • FloodFX
      • ImageFX
      • LightingFX
      • MergeFX
      • MorphologyFX
      • OffsetFX
      • RemapFX
      • SourceFX
      • TurbulenceFX
      • WaveFunctionFX
      • Scintilla
      • Bitmap
      • Clipboard
      • Display
      • Document
      • Font
      • Image
      • Pointer
      • Surface
      • SVG
      • ClientSocket
      • HTTP
      • NetClient
      • NetLookup
      • NetServer
      • NetSocket
      • Proxy
      • Gradient
      • GradientConic
      • GradientContour
      • GradientDiamond
      • GradientDiffusion
      • GradientDistal
      • GradientGouraud
      • GradientLinear
      • GradientMesh
      • GradientRadial
      • GradientVoronoi
      • Vector
      • VectorClip
      • VectorColour
      • VectorEllipse
      • VectorFilter
      • VectorGradient
      • VectorGroup
      • VectorImage
      • VectorPath
      • VectorPattern
      • VectorPolygon
      • VectorRectangle
      • VectorScene
      • VectorShape
      • VectorSpiral
      • VectorText
      • VectorTransition
      • VectorViewport
      • VectorWave
      • Linux Builds
      • Windows Builds
      • Customising Your Build
      • Kōtuku Objects
      • Kōtuku In Depth
      • Kōtuku Design Patterns
      • Coding With AI
      • Regex Manual
      • XML Comparisons
      • Tiri Reference Manual
      • Config API
      • Defer Syntax
      • GUI API
      • HTTP Server API
      • I/O API
      • JSON API
      • OAuth API
      • Options API
      • Proxy Server API
      • Tempus API
      • URL API
      • VFX API
      • Widgets
      • RIPL Reference Manual
      • Origo
      • Flute / Unit Testing
      • Tuku
      • Embedded Document Format
      • TDL Reference Manual
      • TDL Tools
      • Action Reference Manual
      • System Error Codes

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.

 Image*ImageRefers to a Image from which the source Bitmap is acquired.

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

The image 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.
 XUNITApply a horizontal offset to the image, the origin of which is determined by the Units value.
 YUNITApply a vertical offset to the image, the origin of which is determined by the Units value.
VectorImage class documentation © Paul Manias © 2010-2026

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-2026

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-2026

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-2026