L_VecCopyObject

#include "ltvkrn.h"

L_LVKRN_API L_INT L_VecCopyObject(pVectorDst, pLayerDst, pObjectDst, pVectorSrc, pObjectSrc)

Copies a vector object to another object. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameters

pVECTORHANDLE pVectorDst

Pointer to the destination vector handle.

const pVECTORLAYER pLayerDst

Pointer to the destination vector layer.

pVECTOROBJECT pObjectDst

Pointer to the destination vector object.

const pVECTORHANDLE pVectorSrc

Pointer to the source vector handle.

const pVECTOROBJECT pObjectSrc

Pointer to the source vector object.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

This function can be used to do the following:

This function creates a new object that is a carbon copy of the source object, but they are not related. The source object can be deleted after the copying process without affecting the newly copied object.

Setting the pLayerDst parameter to NULL will copy the object into the current active layer in the destination vector handle (pVectorDst).

If the pObjectDst parameter is set to NULL, a handle to the newly added object will not be provided when the function returns. This is similar to calling L_VecAddObject with the pNewObject parameter set to NULL.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will copy the object under current mouse cursor to the active layer of another given vector handle.

L_LTVKRNTEX_API L_INT VecCopyObjectExample( 
   pVECTORHANDLE pVectorSrc, 
   pVECTORHANDLE pVectorDst, 
   const POINT* pptMouse ) 
{ 
   VECTOROBJECT   ObjectSrc; 
   VECTOROBJECT   ObjectDst; 
   L_INT          nRet; 
 
   /* Get object under mouse cursor */ 
   nRet = L_VecHitTest( pVectorSrc, pptMouse, &ObjectSrc ); 
   if( nRet == SUCCESS ) 
   { 
      /* Object was found, copy to destination vector handle. Use the current active layer */ 
      nRet = L_VecCopyObject( pVectorDst, NULL, &ObjectDst, pVectorSrc, &ObjectSrc ); 
   } 
   else if (nRet == ERROR_VECTOR_OBJECT_NOT_FOUND) 
      return SUCCESS; 
 
   return nRet; 
} 

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.