Sets the active layer in the specified vector handle. This function is available in the LEADTOOLS Vector Imaging Toolkit.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecSetActiveLayer(pVector, pLayer)
Pointer to the vector handle.
Pointer to the VECTORLAYER structure that references the layer to set as the active layer.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Some functions use the active layer when NULL is passed for a pVECTORLAYER parameter. This makes it easier to work with the toolkit when layers are not needed.
This example will set the active layer to the one with the given name.
L_INT VecSetActiveLayerExample(
pVECTORHANDLE pVector,
const L_TCHAR* pszName)
{
VECTORLAYER Layer;
L_INT nRet;
/* Get the requested layer */
nRet = L_VecGetLayerByName( pVector, pszName, &Layer );
if( nRet == SUCCESS )
/* Set it as the active layer */
nRet = L_VecSetActiveLayer( pVector, &Layer );
return nRet;
}