SETBKCOLOR

Graphics Function: Sets the current background color index for both text and graphics.

Module: USE DFLIB

Syntax

result = SETBKCOLOR (color)

color
(Input) INTEGER(4). Color index to set the background color to.

Results:

The result is of type INTEGER(4). The result is the previous background color index.

SETBKCOLOR changes the background color index for both text and graphics. The color index of text over the background color is set with SETTEXTCOLOR. The color index of graphics over the background color (used by drawing functions such as FLOODFILL and ELLIPSE) is set with SETCOLOR. These non-RGB color functions use color indexes, not true color values, and limit the user to colors in the palette, at most 256. For access to all system colors, use SETBKCOLORRGB, SETCOLORRGB, and SETTEXTCOLORRGB.

Changing the background color index does not change the screen immediately. The change becomes effective when CLEARSCREEN is executed or when doing text input or output, such as with READ, WRITE, or OUTTEXT. The graphics output function OUTGTEXT does not affect the color of the background.

Generally, INTEGER(4) color arguments refer to color values and INTEGER(2) color arguments refer to color indexes. The two exceptions are GETBKCOLOR and SETBKCOLOR. The default background color index is 0, which is associated with black unless the user remaps the palette with REMAPPALETTERGB.


Note: The SETBKCOLOR routine described here is a QuickWin routine. If you are trying to use the Win32 SDK version of the SetBkColor routine by including the DFWIN module, you need to specify the routine name as MSFWIN$SetBkColor. For more information, see Special Naming Convention for Certain QuickWin and Win32 Graphics Routines in the Programmer's Guide.

Compatibility

STANDARD GRAPHICS QUICKWIN GRAPHICS LIB

See Also: SETBKCOLORRGB, GETBKCOLOR, REMAPALLPALETTERGB, REMAPPALETTERGB, SETCOLOR, SETTEXTCOLOR

Example

 USE DFLIB
 INTEGER(4) i
 i = SETBKCOLOR(14)