Updates a vector layer with new information. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecSetLayer(pVector, pLayer, pLayerDesc)
Pointer to the vector handle.
Pointer to a VECTORLAYER structure that references the vector layer to set.
Pointer to a VECTORLAYERDESC structure that contains the new layer information to set.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
For more information on the layer information that can be set, refer to the VECTORLAYERDESC structure.
To get the layer information for a specific layer, use the L_VecGetLayer function.
This example will make the layer with the given name locked from changes.
L_LTVKRNTEX_API L_INT VecSetLayerExample(
pVECTORHANDLE pVector,
const L_TCHAR* pszName)
{
VECTORLAYER Layer;
VECTORLAYERDESC LayerDesc;
L_INT nRet;
/* find the layer with that name */
nRet = L_VecGetLayerByName( pVector, pszName, &Layer );
if( nRet != SUCCESS )
return nRet; /* layer not found */
/* get this layer for editing */
nRet = L_VecGetLayer( pVector, &Layer, &LayerDesc );
if(nRet != SUCCESS)
return nRet;
/* lock the layer */
LayerDesc.bLocked = TRUE;
/* set back and clean up */
nRet = L_VecSetLayer( pVector, &Layer, &LayerDesc );
if(nRet != SUCCESS)
return nRet;
nRet = L_VecFreeLayer( &LayerDesc );
return nRet;
}