Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_rectangle() draw a rectangle</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _rectangle()            Draw a rectangle

 #include   <graph.h>

 short far _rectangle( fill, x1, y1, x2, y2 );
  short fill;  Fill selection
  short x1, y1;     Upper-left corner
  short x2, y2;     Lower-right corner

    _rectangle() draws a rectangle with the current line style. The
    logical points (x1, y1) and (x2, y2) define the upper-left and lower-
    right corners of the rectangle. The fill argument can be one of the
    following manifest constants defined in graph.h:

    Constant          Meaning
    --------------    --------------------------------
    _GFILLINTERIOR    Fills the figure with the current
                      color using the current fill mask.
    _GBORDER          Does not fill the rectangle.

       Returns:     If successful, _rectangle() returns a nonzero value,
                    otherwise it returns 0.

         Notes:     If you intend to fill the rectangle with
                    _floodfill(), the rectangle must be bordered by a
                    solid line-style pattern. Note that the
                    _gfillinterior 'fill' argument is not limited by the
                    line-style pattern.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

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

    This program draws a filled rectangle.

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

           main()
           {
              _setvideomode( _MRES4COLOR );
              _rectangle( _GFILLINTERIOR, 30,  0, 240, 120 );

              while ( !kbhit() );
              _setvideomode( _DEFAULTMODE );
           }


See Also: _ellipse() _setlinestyle() _getlinestyle() _setcolor()

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