L_VecCopyLayer
#include "lvkrn.h"
L_INT EXT_FUNCTION L_VecCopyLayer(pVectorDst, pLayerDst, pVectorSrc, pLayerSrc, dwFlags)
pVECTORHANDLE pVectorDst; |
/* pointer to a vector handle */ |
const pVECTORLAYER pLayerDst; |
/* pointer to a layer */ |
const pVECTORHANDLE pVectorSrc; |
/* pointer to a vector handle */ |
const pVECTORLAYER pLayerSrc; |
/* pointer to a vector layer */ |
L_UINT32 dwFlags; |
/* copy flags */ |
Copies the contents of one layer to another. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.
Parameter |
Description |
|
pVectorDst |
Pointer to the destination vector handle. |
|
pLayerDst |
Pointer to a VECTORLAYER structure that references the destination layer. |
|
pVectorSrc |
Pointer to the source vector handle. |
|
pLayerSrc |
Pointer to a VECTORLAYER structure that references the source layer. |
|
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
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
LVKRN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Functions: |
L_VecAddLayer, L_VecGetLayer, L_VecGetLayerByName, L_VecGetLayerByIndex |
Topics: |
Example
/* This example will copy the layer with the given name from the source vector to the destination vector */
L_VOID CopyLayerByName( 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 */
L_VecGetLayer( pVectorSrc, &LayerSrc, &LayerDesc );
/* add to the destination vector */
L_VecAddLayer( pVectorDst, &LayerDesc, &LayerDst , VECTOR_FLAGS_RENAME_DUPLICATES);
/* no need for the layer properties anymore */
L_VecFreeLayer( &LayerDesc );
/* copy content of source layer into destination */
L_VecCopyLayer( pVectorDst, &LayerDst, pVectorSrc, &LayerSrc, 0L );
}
}