| Home
| Previous
| Next
| Up

MGL_getPalette

Returns the currently active palette values.

Declaration

void MGLAPI MGL_getPalette(
MGLDC *dc,
palette_t *pal,
int numColors,
int startIndex)

Prototype In

mgraph.h

Parameters

dc | Device context of interest
pal | Place to store the retrieved values
numColors | Number of color values to retrieve
startIndex | Starting palette index value to retrieve

Description

This function copies part or all of the currently active palette values and stores it in the array pal. You can specify only a subset of the palette values to be obtained with the startIndex and numColors arguments.

Thus to save the entire palette in a 256 color video mode, you would use (assuming enough space for the palette has been allocated):

MGL_getPalette(pal,255,0);

or to get the top half of the palette you would use:

MGL_getPalette(pal,128,128);

You should ensure that you have allocated enough memory to hold all of the palette values that you wish to read. You can use MGL_getPaletteSize to determine the size required to save the entire palette.

See Also

MGL_getPaletteEntry, MGL_setPalette, MGL_getDefaultPalette

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com