API Reference Guide > ISIS Component API Reference > ISIS Component Functions Reference > Tag Functions > IG_ISIS_tag_get_rational |
Get current value of a tag of type rational.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_ISIS_tag_get_rational( HISISDRV hDriver, AT_MODE nTag, WORD wIndex, LPAT_ISIS_RAT lpValue ); |
Name | Type | Description |
---|---|---|
hDriver | HISISDRV | The handle to the driver. |
nTag | AT_MODE | Specifies the type rational tag for which to return the current value. |
wIndex | WORD | Specifies the index of the element to get. Most tags have only one element, in which case wIndex must be zero. Use IG_ISIS_tag_get_length to determine how many elements a tag contains. |
lpValue | LPAT_ISIS_RAT | Points to the current value of the tag after this function completes. |
Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.
This function does not process image pixels.
The IG_ISIS_tag_get_rational function retrieves the rational value that is the current value of the specified tag.
Use IG_ISIS_tag_get_rational to retrieve the current value of the type rational tag specified in nTag. Use IG_ISIS_tag_get_length to get the number of elements in the tag. If the tag has only one element, wIndex must be zero. If the tag has multiple elements, loop on IG_ISIS_tag_get_rational to obtain all elements of the current value of the tag.
Use of IG_ISIS_tag_get_rational on a tag other than one of type rational is undefined. At best, this will cause an invalid return value or a operating system error message, and at worst will cause the system to crash.
The tags most commonly defined as rational are the X and Y position and X and Y resolution tags.
The following example gets the current scanning resolution and prints it to the standard output:
Copy Code
|
|
---|---|
AT_ISIS_RAT ratValue;IG_ISIS_tag_get_rational(hDriver, IG_ISIS_TAG_XRESOLUTION, 0, &ratValue); sprintf(caBuffer, "Scanning resolution is %ld DPI\n", (long)(ratValue.Num / ratValue.Denom)); |
IG_ISIS_tag_get_rational_default