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

This function sets a single palette entry in image hIGear's DIB palette.

Declaration:

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

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
lpRGBEntry const LPAT_RGB Far pointer to an AT_RGB struct containing the three color values to be set into the palette entry. Note that this is not an AT_RGBQUAD struct. Also note that the order is Blue, Green, Red in an AT_RGB struct.
nIndex UINT Which palette entry to set, 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      Errcount;         /* Returned count of errors onstack */
/* Set palette entry 255 to a medium-bright yellow, intensity 175:  */
rgbPaletteColor.b = 0;     /* There's no blue in yellow */
rgbPaletteColor.r  =  rgbPaletteColor.g  =  175;
nErrcount = IG_palette_entry_set ( hIGear, &rgbPaletteColor, 255 );