graphics.hlp (
Topic list)
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.
Remapping Palette Functions
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The _remappalette function assigns a new color value to a color
index. The _remapallpalette function remaps all of the color
indexes simultaneously to the colors given in the <colors> array.
Both functions affect the current display immediately.
Both functions work in all graphics modes, but only with EGA,
MCGA, or VGA hardware. An error results if either function is
called while using any other hardware configuration, including
Olivetti or Hercules.
For _remapallpalette, only the first <n> elements of the <colors>
array are used, where <n> is the number of colors supported by the
current video mode. The number <n> can be found as the <numcolors>
element of the videoconfig structure.
For the default color assignments of the color indexes, and an
explanation of specifying a color with a long value, see
◄Graphic Mode Colors►
The _remapallpalette and _remappalette functions do not affect the
presentation-graphics palettes, which are manipulated with the
_pg_getpalette, _pg_setpalette, and _pg_resetpalette functions.
Return Value
If successful, _remapallpalette returns 0 (short) and _remappalette
returns the color value previously assigned to index. Either
function returns -1 if the hardware configuration is incorrect (not
VGA, MCGA, or EGA). The _remappalette function will also return -1
if the color index is out of range.
Note that _remapallpalette returns a short value and _remappalette
returns a long value.
-♦-