Lightweight Graphics

GFloodFill

Fill an area of one color

Syntax

Signature
void GFloodFill( int y, int x, int color );

Arguments

y, x give the starting pixel, vertical coordinate first.

color is the RGB color used to fill the area.

Return value

No return value.

Description

Fills contiguous pixels of the starting color within the current clip. The fill proceeds through horizontal and vertical neighbors and stops at pixels of a different color. Place the starting pixel inside a closed outline to fill its interior.

Example

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

int main( void )
{
   GRect( 20, 20, 100, 100, GMakeColor( 255, 255, 255 ), F );
   GFloodFill( 50, 50, GMakeColor( 0, 200, 200 ) );

   Inkey( 0, NIL );

   return 0;
}

See also