Updates a vector group with new information. This function is available in the LEADTOOLS Vector Imaging Toolkit.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecSetGroup(pVector, pGroup, pGroupDesc)
Pointer to the vector handle.
Pointer to a VECTORGROUP structure that references the vector group to set.
Pointer to a VECTORGROUPDESC structure that contains the new group information to set.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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.
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;
}