L_LVKRN_APIL_INTL_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 aVECTORGROUPDESCstructure that contains the new group settings.
Pointer to aVECTORGROUPstructure 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 toReturn Codes. |
For more information on the group settings, refer to theVECTORGROUPDESCstructure.
To change group settings, get the current group settings by callingL_VecGetGroup, set the new settings in the VECTORGROUPDESC structure pointed to by pGroupDesc and then set the new group settings by callingL_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 );
returnnRet;
}