Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <graph.h>
    long _FAR _setbkcolor( long color );

Description:
    The _setbkcolor function sets the current background color to be that of
    the color argument.  In text modes, the background color controls the
    area behind each individual character.  In graphics modes, the
    background refers to the entire screen.  The default background color is
    0.

    When the current video mode is a graphics mode, any pixels with a zero
    pixel value will change to the color of the color argument.  When the
    current video mode is a text mode, nothing will immediately change; only
    subsequent output is affected.

Returns:
    The _setbkcolor function returns the previous background color.

Example:
    #include <conio.h>
    #include <graph.h>

    long colors[ 16 ] = {
       _BLACK, _BLUE, _GREEN, _CYAN,
       _RED, _MAGENTA, _BROWN, _WHITE,
       _GRAY, _LIGHTBLUE, _LIGHTGREEN, _LIGHTCYAN,
       _LIGHTRED, _LIGHTMAGENTA, _YELLOW, _BRIGHTWHITE
    };

    main()
    {
        long old_bk;
        int bk;

        _setvideomode( _VRES16COLOR );
        old_bk = _getbkcolor();
        for( bk = 0; bk < 16; ++bk ) {
            _setbkcolor( colors[ bk ] );
            getch();
        }
        _setbkcolor( old_bk );
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

See Also:
    _getbkcolor

See Also: _getbkcolor

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson