L_VecAddLayer

#include "ltvkrn.h"

L_LVKRN_API L_INT L_VecAddLayer(pVector, pLayerDesc, pLayer, dwFlags)

Adds a new empty layer to a vector handle.

This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameters

pVECTORHANDLE pVector

Pointer to the vector handle.

const pVECTORLAYERDESC pLayerDesc

Pointer to a VECTORLAYERDESC structure that contains the new layer settings.

pVECTORLAYER pLayer

Pointer to a VECTORLAYER structure to be updated with the handle of the new layer.

L_UINT32 dwFlags

Flag that indicates whether or not to rename duplicate layer names. Possible values are:

Value Meaning
0 Don't rename duplicate layer names, if found.
VECTOR_FLAGS_RENAME_DUPLICATES Renames duplicate layer names if found. The toolkit will add a suffix (0, 1, 2, etc) to the layer name if duplicated. Checking will be aborted when the suffix value reaches 999 and no unique name can be created.

Returns

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

Comments

For more information on the layer settings, refer to the VECTORLAYERDESC structure.

To change layer settings, get the current layer settings by calling L_VecGetLayer, set the new settings in the VECTORLAYERDESC structure pointed to by pLayerDesc and then set the new layer settings by calling L_VecSetLayer.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will add a new layer to a vector handle.

L_LTVKRNTEX_API L_INT VecAddLayerExample(pVECTORHANDLE pVector) 
{ 
   L_INT nRet; 
   VECTORLAYERDESC LayerDesc; 
   VECTORLAYER Layer; 
 
   LayerDesc.nSize = sizeof( VECTORLAYERDESC ); 
   lstrcpy( LayerDesc.szName, TEXT("My Layer")); 
   LayerDesc.bVisible   = TRUE; 
   LayerDesc.bLocked    = FALSE; 
   LayerDesc.dwTag      = 0L; 
 
   nRet = L_VecAddLayer( pVector, &LayerDesc, &Layer, VECTOR_FLAGS_RENAME_DUPLICATES ); 
   if( nRet != SUCCESS) 
      MessageBox( NULL, TEXT("Could not add layer!"), NULL, MB_OK ); 
 
   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.