Graphics.floodFill

Overview | Methods | This Package | All Packages

Graphics.floodFill

Fills a specified area with the current brush.

Syntax

public final void floodFill( Point start, Color color, int type )

public final void floodFill( int x, int y, Color color, int type )

Parameters

start

A Point object that specifies the starting point for the fill.

x

The x-coordinate at which to start the fill.

y

The y-coordinate at which to start the fill.

color

A Color object that specifies the color that the flood fill will use as a boundary.

type

The type of the flood fill. This value must be one of the enumeration constants defined in the FloodFillType class.

Remarks

This method fills an area of the display surface using the current brush. There are two types of flood fills: border and surface.

A border flood fill assumes that the area to be filled is completely bounded by the color specified in the color parameter. A border flood fill begins filling at the specified point and continues in all directions until it reaches the boundary color.

A surface fill assumes that the area to be filled is a single color. It begins filling the area at the specified point and continues in all directions, filling all adjacent regions containing the specified color. The starting point for this fill must already be the color specified in the color parameter.

See Also   fill