ImageGear Professional DLL v17.1 for Windows Accusoft
IG_DIB_palette_alloc
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Core Component API Reference > Core Component Functions Reference > DIB Functions > IG_DIB_palette_alloc

Glossary Item Box

This function allocates a palette for the given DIB.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI IG_DIB_palette_alloc(
        HIGDIBINFO hDIB
);

Arguments:

hDIB DIB info handle.

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:

Indexed RGB: 1…8 bpp

Sample:

None

Example:

  Copy Code
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGDIBINFO hDIB;        /* DIB info handle */
AT_INT nEntries;        /* Number of palette entries */
LPAT_RGBQUAD lpPalette; /* Pointer to palette data */
AT_INT i;               /* Index for palette loop */
/* Make a palette in which every color is GREEN */
nErrcount = IG_DIB_palette_alloc(hDIB);
nEntries = IG_DIB_palette_length_get(hDIB);
lpPalette = IG_DIB_palette_pointer_get(hDIB);
for (i = 0; i < nEntries; i++)
{
        lpPalette[i].rgbRed = lpPalette[i].rgbBlue = 0;
        lpPalette[i].rgbGreen = 255;
}
©2012. Accusoft Corporation. All Rights Reserved.