Lightweight Graphics

GRect

Draw a rectangle in pixels

Syntax

Signature
void GRect( int top, int left, int bottom, int right, int color, xBool filled );

Arguments

top, left, bottom, right give the inclusive bounds in pixels.

color is the RGB color returned by GMakeColor().

filled selects a filled rectangle with T, or an outline with F.

Return value

No return value.

Description

Draws an axis-aligned rectangle within the current clip. Use a filled rectangle to paint the interior, or an outline to leave the existing interior visible.

Example

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

int main( void )
{
   GRect( 40, 40, 120, 200, GMakeColor( 255, 200, 0 ), T );
   GRect( 40, 40, 120, 200, GMakeColor( 255, 255, 255 ), F );

   Inkey( 0, NIL );

   return 0;
}

See also