L_VecCopyLayer

#include "ltvkrn.h"

L_LVKRN_API L_INT L_VecCopyLayer(pVectorDst, pLayerDst, pVectorSrc, pLayerSrc, dwFlags)

Copies the contents of one layer to another. 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 a VECTORLAYER structure that references the destination layer.

const pVECTORHANDLE pVectorSrc

Pointer to the source vector handle.

const pVECTORLAYER pLayerSrc

Pointer to a VECTORLAYER structure that references the source layer.

L_UINT32 dwFlags

Flag that indicates whether or not to empty the destination layer before copying. Possible values are:

Value Meaning
0 Do not empty the destination layer before copying.
VECTOR_FLAGS_REPLACE Empty the destination layer before copying.

Returns

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

Comments

The destination layer can be in the same vector handle as the source layer, or it can be in a different vector handle.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will copy the layer with the given name from the source vector to the destination vector.

L_LTVKRNTEX_API L_INT VecCopyLayerExample( 
   pVECTORHANDLE pVectorDst, 
   pVECTORHANDLE pVectorSrc, 
   L_TCHAR* pszName) 
{ 
   VECTORLAYER       LayerSrc, LayerDst; 
   VECTORLAYERDESC   LayerDesc; 
   L_INT             nRet; 
 
   /* Get the layer with the given name */ 
   nRet = L_VecGetLayerByName( pVectorSrc, pszName, &LayerSrc ); 
   if( nRet == SUCCESS ) 
   { 
      /* get the layer properties */ 
      nRet = L_VecGetLayer( pVectorSrc, &LayerSrc, &LayerDesc ); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* add to the destination vector */ 
      nRet = L_VecAddLayer( pVectorDst, &LayerDesc, &LayerDst, VECTOR_FLAGS_RENAME_DUPLICATES); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* no need for the layer properties anymore */ 
      nRet = L_VecFreeLayer( &LayerDesc ); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* copy content of source layer into destination */ 
      nRet = L_VecCopyLayer( pVectorDst, &LayerDst, pVectorSrc, &LayerSrc, 0L ); 
   } 
 
   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.