Available in LEADTOOLS Vector Imaging toolkits. |
Working with Vector Handles
LEADTOOLS references vector images through an internal VECTORHANDLE structure. Several functions are provided that let you get or set information that pertains to the vector handle itself.
L_VecEmpty deletes all vector layers and vector objects from the specified vector handle. To determine whether a vector handle is empty, call L_VecIsEmpty.
A vector handle can be locked to prevent any changes from being made. L_VecSetLocked locks or unlocks the specified vector handle. Locking a vector handle has precedence over locking vector layers within the vector handle. Therefore, if a vector handle is locked, the layers within that vector handle cannot be edited, even if the vector layers are not locked. To determine whether a vector handle is locked, use L_VecIsLocked.
Each vector handle has an origin point. To get the current origin, call L_VecGetOrigin. To set the origin, call L_VecSetOrigin. The origin may change when new vector objects are added. To center the vector image around its origin, call L_VecSetOrigin(pVector, NULL) after adding new objects.
When a vector object is selected in a vector handle, a marker is used to indicate that the object is selected. The marker settings that indicate how the marker will look can be obtained using L_VecGetMarker. To change these settings call L_VecSetMarker.
A vector handle may contain three-dimensional objects. To determine whether a vector handle does contain 3D objects, call L_VecIs3D.
For each vector handle a bounding parallelogram exists for the vector objects contained in the vector handle. To get the current bounding parallelogram, call L_VecGetParallelogram. To set the bounding parallelogram, call L_VecSetParallelogram. After adding new vector objects to a vector handle the logical size of the image might change. Call L_VecSetParallelogram with either pMin or pMax set to NULL to have the function calculate the bounding rectangle for the vector handle based on the objects contained in the vector handle.
To copy one vector handle to another vector handle call L_VecInit and then L_VecCopy.
The display options for a vector handle determine how the vector objects in that vector handle will be displayed. These display characteristics include the clip mode, anti-aliasing and text rendering options. To determine the current display options, call L_VecGetDisplayOptions. To set or change the display options, use the L_VecSetDisplayOptions function.
In addition to modifying the display options, the appearance of the objects within the vector handle may also be changed by inverting the colors. This is done using the L_VecInvertColors function.