Available in LEADTOOLS Vector Imaging toolkits. |
Working with Vector Layers
LEADTOOLS provides a number of functions for working with the vector layers within a vector handle. Several functions provide a means of obtaining information about vector layers, while other functions provide a means of actually modifying vector layers.
Getting Information about Vector Layers
A vector handle may contain multiple vector layers. The L_VecGetLayerCount returns the number of layers present in a vector handle. Once the number of layers present is known, each layer can be obtained using L_VecGetLayerByIndex. If the name of a layer is known, that layer can be obtained using L_VecGetLayerByName. L_VecEnumLayers actually enumerates all the layers present in a vector handle. The VECTORENUMLAYERSPROC callback function used by L_VecEnumLayers lets you process each enumerated layer.
Within a vector handle one layer is active. L_VecGetActiveLayer obtains a handle to the active vector layer. L_VecSetActiveLayer lets you set the active layer within a vector handle.
Once a handle to a vector layer is obtained, information about that vector layer can be obtained using L_VecGetLayer. This vector layer information can then be modified using L_VecSetLayer. L_VecGetLayer fills a VECTORLAYERDESC structure with the information about the specified vector layer. The information within the VECTORLAYERDESC structure can then be modified and the vector layer information updated using L_VecSetLayer. Once this VECTORLAYERDESC structure is no longer needed, it should be freed using L_VecFreeLayer.
Manipulating Vector Layers
LEADTOOLS provides a number of functions for manipulating vector layers. L_VecSetActiveLayer and L_VecSetLayer let you set the active layer in a vector handle and modify information about a specific vector layer. For more information, refer to Getting Information About Vector Layers above, or the functions themselves.
L_VecEmptyLayer removes all vector objects from a vector layer. L_VecDeleteLayer actually removes a vector layer from a vector handle.
The contents of one layer can be copied to another layer using L_VecCopyLayer.
L_VecAddLayer lets you add a new layer to a vector handle.