Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
GpiRealizeColorTable (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPILOGCOLORTABLE
BOOL GpiRealizeColorTable(hps)
HPS hps; /* presentation-space handle */
The GpiRealizeColorTable function realizes the logical color table. The
function realizes the color table by replacing the colors in the physical
palette. It replaces the physical palette colors with the device colors that
most closely match the RGB color values given in the logical color table.
To realize a logical color table, the application must create the table
using the LCOL_REALIZABLE option of the GpiCreateLogColorTable function and
the device must be capable of realizing logical color tables. The
DevQueryCaps function and CAPS_COLOR option can be used to determine if
logical color tables can be realized.
If the presentation space is currently associated with a screen window
device, this function should be used only when the associated window is
maximized. Changing the physical palette colors for the screen affects
output for all visible windows.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
Return Value
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
Errors
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
PMERR_COL_TABLE_NOT_REALIZABLE
PMERR_INV_HPS
PMERR_PS_BUSY
Example
This example uses the GpiRealizeColorTable function to realize the logical
color table. The GpiUnrealizeColorTable function is used to restore the
physical palette after the drawing is complete.
RGB argb[16]; /* RGB color values for new logical color table */
/* Create a realizable logical color table. */
GpiCreateLogColorTable(hps, LCOL_REALIZABLE, LCOLF_CONSECRGB,
0L, 16L, argb);
GpiRealizeColorTable(hps); /* realizes the logical color table */
.
.
.
GpiUnrealizeColorTable(hps); /* restores the physical palette */
See Also
DevQueryCaps, GpiUnrealizeColorTable, WinGetLastError
♦