[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Graphics' (#lcl)

# TCanvas.FloodFill

Fills an area at the specified coordinates with the current Brush for the canvas.

## Declaration

Source position: graphics.pp line 1120

`public procedure TCanvas.FloodFill(`
`X: Integer;`
`Y: Integer;`
`FillColor: TColor;`
`FillStyle: TFillStyle`
`); virtual;`

## Arguments

`X` |  | Horizontal coordinate where the fill operation is performed.
`Y` |  | Vertical coordinate where the fill operation is performed.
`FillColor` |  | Color replaced or used as a boundary in the fill operation.
`FillStyle` |  | Determines whether FillColor is the boundary or the target for the fill operation.

## Description

FloodFill is a method used to fill the area at the point specified in X, Y with the style, color, or bitmap defined in Brush.

FillColor contains the color value for the boundary of the fill, or the area to be filled, depending on the value in FillStyle.

FillStyle determines the type of fill operation performed in the method. For example:

fsBorder
  The fill area is bounded by pixels with the color specified in FillColor. Pixels are filled in all directions with the Brush until the a pixel with the specified color is found.
fsSurface
  The fill area is defined as the color specified in FillColor. Pixels with this color are filled in all directions with the Brush until no more pixels with this color are found.

Please note that comments in the TGraphicsFillStyle source code have these conditions reversed.

FloodFill calls the routine in the LCL interface used to implement the method for the widgetset. The return value from the LCL interface is ignored.

## See also

TCanvas.Brush |  | The Brush used to paint on the Canvas.
TColor |  | Color type used by most LCL drawing functions.
TFillStyle |  | Alias for the TGraphicsFillStyle enumeration type in LazUtils.
TGraphicsFillStyle
LCLIntf.FloodFill |  | Fills an area of the display surface with the current brush.