ImageGear for C and C++ on Windows v19.7 - Updated
IG_ISIS_tag_get_length
API Reference Guide > ISIS Component API Reference > ISIS Component Functions Reference > Tag Functions > IG_ISIS_tag_get_length

Get the number of elements in current value of a tag.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_ISIS_tag_get_length(
        HISISDRV hDriver,
        AT_MODE nTag,
        LPDWORD lpdwLength
);

Arguments:

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.

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_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.

Example:

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);

See Also

IG_ISIS_tag_get_ascii

IG_ISIS_tag_get_length_default

IG_ISIS_tag_get_long

IG_ISIS_tag_get_rational

IG_ISIS_tag_get_type

IG_ISIS_tag_set_ascii

IG_ISIS_tag_set_long

IG_ISIS_tag_set_rational