Name
FloodFill -- flood fill a brush area with a color (V2.0)
Synopsis
FloodFill(id, x, y, bordercolor, color)
Function
This function can be used to flood fill a bordered area in the brush specified by id with a color. You need to pass a starting position in the x and y arguments. FloodFill() will then start out in all directions replacing all pixels with the specified color until it reaches the border color which you also have to specify. The starting position is usually an arbitrary point within the bounded area.

Inputs
id
brush to use for flood fill
x
start x-position for the fill operation
y
start y-position for the fill operation
bordercolor
color of the border
color
color to use for filling
Example
CreateBrush(1, 241, 201)
SelectBrush(1)
SetFillStyle(#FILLNONE)
Ellipse(0, 0, 120, 100, #RED)
EndSelect
FloodFill(1, 120, 100, #RED, #WHITE)
DisplayBrush(1, 0, 0)
Creates a red ellipse outline and then fills it with the color white using the FloodFill() command starting from the center of the ellipse in all directions.

Show TOC