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>getbkcolor() get the current background color</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getbkcolor()            Get the Current Background Color

 #include   <graphics.h>

 int far    getbkcolor(void);

    getbkcolor() returns 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:    The value of the current background color.

   -------------------------------- 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: getcolor() getpalette() getmaxcolor() setbkcolor() setcolor()

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