L_VecSetGroup

#include "lvkrn.h"

L_LVKRN_API L_INT L_VecSetGroup(pVector, pGroup, pGroupDesc)

pVECTORHANDLE pVector;

/* pointer to a vector handle */

const pVECTORGROUP pGroup;

/* pointer to a vector group */

const pVECTORGROUPDESC pGroupDesc;

/* pointer to a structure */

Updates a vector group with new information. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.

Parameter

Description

pVector

Pointer to the vector handle.

pGroup

Pointer to a VECTORGROUP structure that references the vector group to set.

pGroupDesc

Pointer to a VECTORGROUPDESC structure that contains the new group information to set.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

For more information on the group information that can be set, refer to the VECTORGROUPDESC structure.

To get the group information for a specific group, use the L_VecGetGroup function.

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_VecGetGroup, L_VecFreeGroup

Topics:

Working with Vector Groups

Example

This example will change the name of a given group.

L_INT VecSetGroupExample(
   pVECTORHANDLE pVector,
   const L_TCHAR* pszOldName,
   const L_TCHAR* pszNewName)
{
   VECTORGROUP       Group;
   VECTORGROUPDESC   GroupDesc;
   L_INT             nRet;

   /* find the group with that name */
   nRet = L_VecGetGroupByName( pVector, pszOldName, &Group );
   if( nRet != SUCCESS )
      return nRet;  /* group not found */

   /* get this group for editing */
   nRet = L_VecGetGroup( pVector, &Group, &GroupDesc );
   if(nRet != SUCCESS)
      return nRet;

   /* set new name */
   lstrcpy( GroupDesc.szName, pszNewName ); 

   /* set back and clean up */
   nRet = L_VecSetGroup( pVector, &Group, &GroupDesc );
   if(nRet != SUCCESS)
      return nRet;

   nRet = L_VecFreeGroup( &GroupDesc );

   return nRet;
}