L_VecCopyGroup

#include "lvkrn.h"

L_LVKRN_API L_INT L_VecCopyGroup(pVectorDst, pGroupDst, pVectorSrc, pGroupSrc, dwFlags)

Copies the contents of one group to another. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameters

pVECTORHANDLE pVectorDst

Pointer to the destination vector handle.

const pVECTORGROUP pGroupDst

Pointer to a VECTORGROUP structure that references the destination group.

const pVECTORHANDLE pVectorSrc

Pointer to the source vector handle.

const pVECTORGROUP pGroupSrc

Pointer to a VECTORGROUP structure that references the source group.

L_UINT32 dwFlags

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

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

Returns

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

Comments

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

Required DLLs and Libraries

See Also

Functions

Topics

Example

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

L_INT VecCopyGroupExample( 
   pVECTORHANDLE pVectorDst, 
   pVECTORHANDLE pVectorSrc, 
   L_TCHAR* pszName) 
{ 
   VECTORGROUP       GroupSrc, GroupDst; 
   VECTORGROUPDESC   GroupDesc; 
   L_INT             nRet; 
 
   /* Get the group with the given name */ 
   nRet = L_VecGetGroupByName( pVectorSrc, pszName, &GroupSrc ); 
   if( nRet == SUCCESS ) 
   { 
      /* get the group properties */ 
      nRet = L_VecGetGroup( pVectorSrc, &GroupSrc, &GroupDesc ); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* add to the destination vector */ 
      nRet = L_VecAddGroup( pVectorDst, &GroupDesc, &GroupDst , VECTOR_FLAGS_RENAME_DUPLICATES); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* no need for the group properties anymore */ 
      nRet = L_VecFreeGroup( &GroupDesc ); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* copy content of source group into destination */ 
      nRet = L_VecCopyGroup( pVectorDst, &GroupDst, pVectorSrc, &GroupSrc, 0L ); 
   } 
 
   return nRet; 
} 

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

LEADTOOLS Vector C API Help