Deletes an object from a vector image. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecDeleteObject(pVector, pObject, dwFlags)
Pointer to a vector handle. Objects within this vector handle will be deleted.
Pointer to a VECTOROBJECT structure that references the object to be deleted. If this parameter is not NULL, only the specified object will be deleted. If this parameter is NULL, the objects to delete are determined by dwFlags.
Flag that indicates which objects to delete. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:
Value | Meaning |
---|---|
0 | Delete all objects. |
VECTOR_FLAGS_SELECTED_ONLY | Delete only the currently selected objects within the vector handle. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Deletes all or part of the specified vector image.
Note: When you delete a certain object, it may or may not effect other unselected objects sharing vertices with the selected object. This depends on the current bind vertices mode set by L_VecSetBindVerticesMode.
Note: In DirectX, you cannot delete objects, therefore this function does nothing.
This example will delete the object under the mouse cursor.
L_LTVKRNTEX_API L_INT VecDeleteObjectExample(
pVECTORHANDLE pVector,
POINT* pptMouse)
{
VECTOROBJECT Object;
L_INT nRet;
/* Get object under mouse pointer */
nRet = L_VecHitTest( pVector, pptMouse, &Object );
if( nRet == SUCCESS )
/* Delete it */
nRet = L_VecDeleteObject( pVector, &Object, 0L );
return nRet;
}