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>_setviewport() set clipping region, reset origin</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _setviewport()          Set clipping region, reset origin

 #include   <graph.h>

 void far _setviewport( x1, y1, x2, y2 );
  short x1, y1;     Upper-left corner of clip region
  short x2, y2;     Lower-right corner of clip region

    _setviewport() limits the display of images to a particular area of
    the screen, known as the "clipping region", and resets the logical
    origin to the upper left corner of the region. The physical points
    (x1, y1) and (x2, y2) mark the upper-left and lower-right corners of
    a rectangle defining the clipping region.

         Notes:     _setviewport() affects images only, not text. To mask
                    the screen for text output use _settextwindow().

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

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

    This program draws a filled ellipse that partially extends beyond the
    boundaries of a clipping region on all four sides.

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

           main()
           {
              _setvideomode( _MRES4COLOR );
              _setviewport( 100, 40, 260, 140 );
              _ellipse( _GFILLINTERIOR, 30,  0, 240, 120 );

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


See Also: _setcliprgn() _settextwindow()

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