Flood_Fill

Flood_Fill(X, Y, Color)

 

Flood_Fill is a call that paints an area of the graphics window a  given color.  It begins at the given point (X,Y).  Then it fills the entire region containing (X,Y) with the given color. The boundary for the region is defined by those pixels that are a different color than the starting point for the fill, normally the background color. Note that the boundary pixels are not necessarily the same color as the prescribed fill color. For example, a red Flood_Fill operation started at a white pixel can be bounded by the pixels of a green ellipse.

 

Note:  A graphics window must be open when Flood_Fill is called or a run-time error will occur.

 

Example:

 

Flood_Fill(X1+1,Y1-1,Red)

yields the following picture, assuming the red region was previously all white.