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>bar() draw and fills a bar</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 bar()                   Draw and Fills a Bar

 #include   <graphics.h>

 void       far bar(l,t,r,b);
 int        l;
 int        t;
 int        r;
 int        b;

    bar() draws and fills in a rectangular bar.  The bar is drawn using
    the upper left coordinates ('l','t') and the lower right coordinates
    ('r','b').  The current fill pattern and fill color is used to fill
    in the  bar.  The bar is not outlined.

    Returns:    Nothing.

       Note:    To outline a bar, use bar3d() with a 'depth' of 0.

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

    The following statements draw three bars and fill them with different
    patterns and colors.

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

           int gdriver = DETECT;
           int gmode;

           main()
           {
               initgraph(&gdriver,&gmode,"");
               setfillstyle(SOLID_FILL,RED);
               bar(10,10,100,100);
               setfillstyle(HATCH_FILL,BLUE);
               bar(200,10,300,100);
               setfillstyle(LINE_FILL,YELLOW);
               bar(400,10,500,100);
               getch();
               closegraph();
           }


See Also: bar3d()

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