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

Set the number of elements in a tag.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_ISIS_tag_set_length(
        HISISDRV hDriver,
        AT_MODE nTag,
        DWORD dwLength
);

Arguments:

Name Type Description
hDriver HISISDRV The handle to the driver.
nTag AT_MODE Specifies the tag to set.
dwLength DWORD Specifies the number of elements for nTag. (Default is 1.)

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_set_length function sets the number of elements in the specified tag. Most integer and rational tags have only one element and do not need their lengths set. The length of an ASCII tag is set automatically and does not need its length explicitly set.

Use IG_ISIS_tag_set_length to set the number of elements in the specified nTag to a value other than?1. An example of a multiple-element tag is IG_ISIS_TAG_GAMMA_TABLE1, which often requires a table of 256 values for each possible setting.

Do not use IG_ISIS_tag_set_length for ASCII tags-their length is set automatically when IG_ISIS_tag_set_ascii is called.

The IG_ISIS_tag_set_length function is most commonly used to set the sizes of dithers and gammas on scanners.

Example:

The following example defines a function in a driver for setting gamma tables. It uses IG_ISIS_tag_set_length to set the number of elements in the resulting gamma table.

 
Copy Code
void SetGammaTable (
  HISISDRV                                      hDriver,
  LONG                                  lLength,
  BYTE                                  FAR *lpGammaBuffer)
  {IG_ISIS_tag_set_long (hDriver, IG_ISIS_TAG_GAMMA_LENGTH1, 0, lLength) ;IG_ISIS_tag_set_long (hDriver, IG_ISIS_TAG_GAMMA_TABLE1, 0, 0) ;IG_ISIS_tag_set_length(hDriver, IG_ISIS_TAG_GAMMA_TABLE1, lLength) ;
  while (lLength--)IG_ISIS_tag_set_long (hDriver, IG_ISIS_TAG_GAMMA_TABLE1, lLength,
                                   (LONG) lpGammaBuffer[lLength]) ;
  }

See Also

IG_ISIS_tag_get_length

IG_ISIS_tag_get_length_default