Get the type of a tag.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI IG_ISIS_tag_get_type( HISISDRV hDriver, AT_MODE nTag, LPAT_MODE lpnType ); |
Arguments:
Name | Type | Description | ||
hDriver | HISISDRV | The handle to the driver. | ||
nTag | AT_MODE | Specifies the tag for which to return the type. | ||
lpnType | LPAT_MODE |
Points to the address which will contain the type of wTag after this function completes. lpnType is filled in with one of the following values:
|
Return Value:
Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.
Supported Raster Image Formats:
This function does not process image pixels.
Remarks:
The IG_ISIS_tag_get_type function retrieves the type of the specified tag.
Use IG_ISIS_tag_get_type to determine the type of a tag before performing other functions such as IG_ISIS_tag_get_long, IG_ISIS_tag_get_long_default, etc., or IG_ISIS_choice_get_long, etc..
Example:
The following example returns a text string that indicates the type of a tag based on checking the tag inside a driver.
Copy Code | |
---|---|
char FAR *GetTagText (HISISDRV hDriver, AT_MODE nTag) { DWORD dwLength ; LONG lTemp ; WORD wTemp ; AT_ISIS_RAT ratValue ; char FAR *cpString ; if (IG_ISIS_tag_get_type (hDriver, nTag, &wTemp)) return NULL ; switch (wTemp) { case IG_ISIS_TAG_TYPE_STRING:IG_ISIS_tag_get_length (hDriver, nTag, &dwLength) ; if (NULL == (cpString = (char FAR *) malloc((ulLength + 1)))) return NULL ;IG_ISIS_tag_get_ascii (hDriver, nTag, dwLength, cpString) ; return cpString ; case IG_ISIS_TAG_TYPE_BYTE: case IG_ISIS_TAG_TYPE_SHORT: case IG_ISIS_TAG_TYPE_LONG: /* Return only first value. */ if (NULL == (cpString = (char FAR *) malloc(20))) return NULL ;IG_ISIS_tag_get_long (hDriver, nTag, 0, &lTemp) ; sprintf (cpString, "%d", lTemp, 0) ; return cpString ; case IG_ISIS_TAG_TYPE_RATIONAL: /* Return only first value. */ if (NULL == (cpString = (char FAR *) malloc(20))) return NULL ;IG_ISIS_tag_get_long (hDriver, nTag, 0, &ratValue) ; lTemp = (LONG) (ratValue.Num / ratValue.Denom) ; sprintf (cpString, "%d", lTemp, 0) ; return cpString ; default: return NULL ; } } |
See Also
IG_ISIS_tag_get_length_default
IG_ISIS_tag_get_rational_default