ImageGear for C and C++ on Linux v18.8 - Updated
IG_palette_entry_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Palette Functions > IG_palette_entry_get

This function obtains from image hIGear's DIB palette, the palette entry indicated by nIndex.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_palette_entry_get (
        HIGEAR hIGear, 
        LPAT_RGB lpRGBEntry, 
        UINT nIndex 
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
lpRGBEntry LPAT_RGB Far pointer to an AT_RGB struct to receive the three color values of the palette entry. (Note that this is not an AT_RGBQUAD struct. Also note that the order of the bytes is Blue, Green, Red in an AT_RGB struct.)
nIndex UINT Which palette entry to get, 0 to 255.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

Indexed RGB - 1…8 bpp.

Example:

 
Copy Code
HIGEAR hIGear;           /* HIGEAR handle of image    */
AT_RGB rgbPaletteColor;  /* Will hold returned color   */
AT_ERRCOUNT nErrcount;        /* Returned count of errors on stack*/
/* Get palette entry 255: */
nErrcount = IG_palette_entry_get ( hIGear, &rgbPaletteColor, 255 );