API Reference Guide > ISIS Component API Reference > ISIS Component Functions Reference > Tag Functions > IG_ISIS_tag_get_long |
Get current value of a tag of type long.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_ISIS_tag_get_long( HISISDRV hDriver, AT_MODE nTag, WORD wIndex, LPLONG lplValue ); |
Name | Type | Description |
---|---|---|
hDriver | HISISDRV | The handle to the driver. |
nTag | AT_MODE | Specifies the type long 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. |
lplValue | LPLONG | 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_long function retrieves the long value that is the current value of the specified tag.
Use IG_ISIS_tag_get_long to retrieve the current value of the type long 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 (such as IG_ISIS_TAG_GAMMA_TABLE1), loop on IG_ISIS_tag_get_long to obtain all elements of the current value of the tag.
Use of IG_ISIS_tag_get_long on a tag other than one of type long, short, or byte 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 following example gets the value of each element of a multiple value tag and puts them into an array:
Copy Code
|
|
---|---|
BYTE caGamma[256]; DWORD dwCount; LONG lValue;IG_ISIS_tag_get_length(hDriver, IG_ISIS_TAG_GAMMA_TABLE1, &dwCount); while (dwCount--) {IG_ISIS_tag_get_long(hDriver, IG_ISIS_TAG_GAMMA_TABLE1, dwCount, &lValue); caGamma[ulCount] = (BYTE) lValue; } /* Now that you have the values in an array, you can do something */ /* with them in your own function, such as: */ showGamma(caGamma); |