Lightweight Graphics

GSetClip

Limit drawing to a rectangle

Syntax

Signature
void GSetClip( int top, int left, int bottom, int right );

Arguments

top, left, bottom, right give the inclusive clipping bounds in pixels. Pass four zeros to restore drawing to the whole window.

Return value

No return value.

Description

Limits subsequent pixel drawing to the selected rectangle. The driver orders the two corners by their horizontal and vertical coordinates. The clip stays in effect until another GSetClip() call replaces it or resets it.

Example

gsetclip.c
#include "xdev-wtui.h"

int main( void )
{
   GSetClip( 50, 50, 100, 150 );
   GRect( 0, 0, 200, 300, GMakeColor( 0, 0, 255 ), T );
   GSetClip( 0, 0, 0, 0 );

   Inkey( 0, NIL );

   return 0;
}

See also