L_LVKRN_API L_INT L_VecAddGroup(pVector, pGroupDesc, pGroup, dwFlags)
Adds a new empty group to a vector handle. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.
Pointer to the vector handle.
Pointer to a VECTORGROUPDESC structure that contains the new group settings.
Pointer to a VECTORGROUP structure to be updated with the handle of the new group.
Flag that indicates whether or not to rename duplicate group names. Possible values are:
Value | Meaning |
---|---|
0 | Don't rename duplicate group names, if found. |
VECTOR_FLAGS_RENAME_DUPLICATES | Renames duplicate group names if found. The toolkit will add a suffix (0, 1, 2, etc) to the group name if duplicated. Checking will be aborted when the suffix value reaches 999 and no unique name can be created. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
For more information on the group settings, refer to the VECTORGROUPDESC structure.
To change group settings, get the current group settings by calling L_VecGetGroup, set the new settings in the VECTORGROUPDESC structure pointed to by pGroupDesc and then set the new group settings by calling L_VecSetGroup.
Required DLLs and Libraries
This example will add a new group to a vector handle.
L_LTVKRNTEX_API L_INT VecAddGroupExample(pVECTORHANDLE * ppVector)
{
L_INT nRet;
VECTORGROUPDESC GroupDesc;
VECTORGROUP Group;
GroupDesc.nSize = sizeof( VECTORGROUPDESC );
lstrcpy( GroupDesc.szName, TEXT("My Group"));
GroupDesc.dwTag = 0L;
nRet = L_VecAddGroup( *ppVector, &GroupDesc, &Group, VECTOR_FLAGS_RENAME_DUPLICATES );
if(nRet != SUCCESS)
MessageBox( NULL, TEXT("Could not add group!"), NULL, MB_OK );
return nRet;
}