L_VecGetLayerCount

Summary

Returns the number of layers inside a vector handle.

Syntax

#include "ltvkrn.h"

L_LVKRN_API L_INT L_VecGetLayerCount(pVector)

Parameters

const pVECTORHANDLE pVector

Pointer to the vector handle.

Returns

Number of layers.

Comments

After calling this function, L_VecGetLayerByIndex can be used to iterate through the layers in a vector handle.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will show the names of the all layers inside a vector handle, in a message box.

L_INT VecGetLayerCountExample(pVECTORHANDLE pVector) 
{ 
   L_INT nRet; 
   L_INT nCount, i; 
   VECTORLAYER Layer; 
   VECTORLAYERDESC LayerDesc; 
 
   /* Get number of layers inside the vector handle */ 
   nCount = L_VecGetLayerCount( pVector ); 
 
   nRet = SUCCESS; 
   /* Iterate through the layers */ 
   for( i = 0; i < nCount; i++ ) 
   { 
      /* Get layer and its descriptor */ 
      nRet = L_VecGetLayerByIndex( pVector, i, &Layer ); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      nRet = L_VecGetLayer( pVector, &Layer, &LayerDesc ); 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* Show name in a message box */ 
      MessageBox( NULL, LayerDesc.szName, TEXT("Layer Name"), MB_OK ); 
 
      /* Free the layer descriptor because it's no longer needed */ 
      nRet = L_VecFreeLayer( &LayerDesc ); 
   } 
 
   return nRet; 
} 

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

LEADTOOLS Vector C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.