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.
GpiQueryRGBColor (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPILOGCOLORTABLE
LONG GpiQueryRGBColor(hps, flClrType, lColorIndex)
HPS hps; /* presentation-space handle */
ULONG flClrType; /* color type */
LONG lColorIndex; /* color-index value */
The GpiQueryRGBColor function returns the RGB color value in the physical
palette that corresponds to the color-index value specified by the
lColorIndex parameter.
If the current logical color table is realizable but has not been realized,
the LCOLOPT_REALIZED option maps the color-index value as if the logical
color table has been realized. Since realizing a logical color table affects
the contents of the physical palette, the RGB color value returned with this
option may be different from the value returned without the option.
If the current logical color table was created using the LCOLF_RGB option,
the lColorIndex parameter is interpreted as an RGB color value. In this
case, the function is identical to the GpiQueryNearestColor function.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
flClrType Specifies whether the RGB color value is based on realized
colors. If it is LCOLOPT_REALIZED, the function returns an RGB
color based on the colors in the physical palette after the
current logical color table is realized. If the parameter is
zero, the function returns an RGB color based on the colors in
the current physical palette.
lColorIndex Specifies the color index. This may be any valid color-index
value except CLR_DEFAULT.
Return Value
The return value is the RGB color that is the closest match if the function
is successful or GPI_ALTERROR if an error occurred.
Errors
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
PMERR_INV_COLOR_INDEX
PMERR_INV_COLOR_OPTIONS
PMERR_INV_HPS
PMERR_PS_BUSY
See Also
GpiCreateLogColorTable, GpiQueryColorData, GpiQueryNearestColor,
GpiQueryRealColors, GpiQueryRGBColor, GpiSetColor, WinGetLastError
♦