Explodes a vector object or objects to smaller parts. This function is available in the LEADTOOLS Vector Imaging Toolkit.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecExplodeObject(pVector, pObject, dwFlags)
Pointer to a vector handle.
Pointer to a vector object.
Flag that indicates which object(s) to explode. Possible values are:
Value | Meaning |
---|---|
0 | Explode all objects |
VECTOR_FLAGS_SELECTED_ONLY | Explode only selected objects. |
VECTOR_FLAGS_EXPLODE_TO_LINES | Explode object into lines. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
If pObject is NULL and dwFlags is set to VECTOR_FLAGS_SELECTED_ONLY, this function will explode only selected objects within the vector handle.
If pObject is NULL and dwFlags is set to 0, this function will explode all objects within the vector handle.
If pObject is not NULL, only the specified object is exploded and dwFlags is ignored.
If the VECTOR_FLAGS_EXPLODE_TO_LINES flag is not specified, then not all objects can be exploded. For example an attempt to explode a VECTOR_LINE has no effect and returns SUCCESS.
Below is a list of object types and the objects into which they explode:
Object type | After L_VecExplodeObject |
---|---|
VECTOR_ARC | Same. |
VECTOR_CHORD | Same. |
VECTOR_CIRCLE | Same. |
VECTOR_CLONE | The objects inside the group will be added to the vector handle. |
VECTOR_ELLIPSE | Same. |
VECTOR_ELLIPTICALARC | Same. |
VECTOR_LINE | Same. |
VECTOR_PIE | Same. |
VECTOR_POLYBEZIER | ( (nPointCount + 2) / 3 ) - 1 VECTOR_POLYBEZIERs. |
VECTOR_POLYDRAW | VECTOR_LINEs and VECTOR_POLYBEZIERs. |
VECTOR_POLYGON | nPointCount + 1 VECTOR_LINEs |
VECTOR_POLYLINE | nPointCount of VECTOR_LINE's. |
VECTOR_RASTER | Same. |
VECTOR_RECTANGLE | 4 VECTOR_LINE's. |
VECTOR_TEXT | Same. |
VECTOR_VERTEX | Same. |
This example will explode all selected objects inside a vector handle.
L_INT VecExplodeObjectExample(pVECTORHANDLE pVector)
{
L_INT nRet;
nRet = L_VecExplodeObject( pVector, NULL, VECTOR_FLAGS_SELECTED_ONLY );
return nRet;
}