Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>setbkcolor() set the background color</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 setbkcolor()            Set the Background Color

 #include   <graphics.h>

 void far   setbkcolor(color);
 int        color;

    setbkcolor() sets the current background color which can be one of
    the following values defined in <graphics.h>:

          Value     Name

            0       BLACK
            1       BLUE
            2       GREEN
            3       CYAN
            4       RED
            5       MAGENTA
            6       BROWN
            7       LIGHTGRAY
            8       DARKGRAY
            9       LIGHTBLUE
           10       LIGHTGREEN
           11       LIGHTCYAN
           12       LIGHTRED
           13       LIGHTMAGENTA
           14       YELLOW
           15       WHITE


    Returns:    Nothing.

   -------------------------------- Example ---------------------------------

    The following statements save the original background color, set the
    background color to a new value and then restore the original color.

           #include <graphics.h>
           #include <conio.h>

           int gdriver = DETECT;
           int gmode;

           main()
           {
               int whcolor;

               initgraph(&gdriver,&gmode,"");
               whcolor = getbkcolor();
               setbkcolor(4);
               getch();
               cleardevice();
               setbkcolor(whcolor);
               closegraph();
           }


See Also: getbkcolor() getcolor() getpalette() getmaxcolor() setcolor()

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