_setcliprgn

Description

Sets the clipping region for graphics.

#include <graph.h>

void __far _setcliprgn( short x1, short y1, short x2, short y2 );

x1, y1 Upper-left corner of clip region  
x2, y2 Lower-right corner of clip region  

Remarks

The _setcliprgn function limits the display of subsequent graphics output and font text output to an area of the screen called the “clipping region.” The physical points (x1, y1) and (x2, y2) are the diagonally opposed sides of a rectangle that defines the clipping region. This function does not change the view coordinate system. Rather, it merely masks the screen.

Note that the _setcliprgn function affects graphics and font text output only. To mask the screen for text output, use the _settextwindow function.

Return Value

None.

Compatibility

Standards:None

16-Bit:DOS

32-Bit:None

See Also

_settextwindow, _setvieworg, _setviewport, _setwindow

Example

/* SCLIPRGN.C */

#include <stdlib.h>

#include <conio.h>

#include <graph.h>

void main( void )

{

/* Find a valid graphics mode. */

if( !_setvideomode( _MAXRESMODE ) )

exit( 1 );

/* Set clip region, then draw an ellipse larger than the region. */

_setcliprgn( 0, 0, 200, 125 );

_ellipse( _GFILLINTERIOR, 80, 50, 240, 190 );

_getch();

_setvideomode( _DEFAULTMODE );

exit( 0 );

}