Get the number of elements in current value of a tag.
|
Copy Code
|
|
|---|---|
AT_ERRCOUNT ACCUAPI IG_ISIS_tag_get_length(
HISISDRV hDriver,
AT_MODE nTag,
LPDWORD lpdwLength
);
|
|
| Name | Type | Description |
|---|---|---|
| hDriver | HISISDRV | The handle to the driver. |
| nTag | AT_MODE | Specifies the tag for which to return the length. |
| lpdwLength | LPDWORD | Points to the address which will contain the number of elements in nTag 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_length function retrieves the number of elements in the current value of the specified tag. In the case of an ASCII tag, IG_ISIS_tag_get_length returns the number of characters in the current value of the tag.
Use IG_ISIS_tag_get_length to retrieve the length of the current value of the tag specified in nTag. This function is especially useful in determining a buffer size to hold the value returned by IG_ISIS_tag_get_ascii, because it obtains the number of characters in the current value of the tag, including the NULL terminator. For most other tags, *lpdwLength is 1.
The following example gets the length of IG_ISIS_TAG_DITHER, allocates enough memory to hold the string, and then gets the ASCII value of IG_ISIS_TAG_DITHER and puts it in the buffer:
|
Copy Code
|
|
|---|---|
IG_ISIS_tag_get_length
(hDriver,
IG_ISIS_TAG_DITHER
, &ulLength);
lpBuffer = malloc((ulLength + 1));IG_ISIS_tag_get_ascii(hDriver, IG_ISIS_TAG_DITHER, ulLength, lpBuffer);
|
|
IG_ISIS_tag_get_length_default