gpi12.hlp (Table of Contents; 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.
GpiSetBackColor (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIPRIMITIVES
 
BOOL GpiSetBackColor(hps, clr)
HPS hps;     /* presentation-space handle */
LONG clr;    /* background color          */
 
The GpiSetBackColor function sets the current background color for all
primitive types. The background color specifies the color used to fill the
background of the primitive, such as the gaps between dashes in a styled
line. The function sets the background color to the color specified by clr.
The clr parameter is either an RGB color value or a color-index value,
depending on the current logical color table. The actual color the clr
parameter represents also depends on the current logical color table.
 
If the attribute mode is AM_PRESERVE, the function saves the previous
background color on the attribute stack when it sets the new color. The
previous background color can be retrieved by using the GpiPop function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
clr        Specifies the color. The values depend on the current logical
           color table. If the logical color table has been created using
           the LCOLF_RGB constant, the values must be RGB color values.
           Otherwise, the values must be color-index values. If the default
           logical color table is used, the parameter can be any one of the
           following standard color-index values:
 
           Value           Meaning
           ─────────────────────────────────────────────────────────────────
           CLR_FALSE       All color planes are zero.
 
           CLR_TRUE        All color planes are 1.
 
           CLR_DEFAULT     Set to default value; same as zero.
 
           CLR_WHITE       White.
 
           CLR_BLACK       Black.
 
           CLR_BACKGROUND  Reset color (used by the GpiErase function).
 
           CLR_BLUE        Blue.
 
           CLR_RED         Red.
 
           CLR_PINK        Pink.
 
           CLR_GREEN       Green.
 
           CLR_CYAN        Cyan.
 
           CLR_YELLOW      Yellow.
 
           CLR_NEUTRAL     Neutral.
 
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
the following:
 
     PMERR_INV_BACKGROUND_COL_ATTR
     PMERR_INV_HPS
     PMERR_INV_IN_RETAIN_MODE
     PMERR_PS_BUSY
 
Comments
 
The functions that draw primitives use the background-mix mode to combine
the background color with colors already on the display surface. If the
background-mix mode is BM_LEAVEALONE, the background color is ignored and
existing colors remain unchanged.
 
See Also
 
GpiCreateLogColorTable, GpiErase, GpiPop, GpiSetBackMix, WinGetLastError