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

# TWidgetSet.FloodFill

Fills an area of the display surface with the current brush.

## Declaration

Source position: winapih.inc line 105

`public function TWidgetSet.FloodFill(`
`DC: HDC;`
`X: Integer;`
`Y: Integer;`
`Color: TGraphicsColor;`
`FillStyle: TGraphicsFillStyle;`
`Brush: HBRUSH`
`):Boolean; virtual;`

## Arguments

`DC` |  | The device context.
`X` |  | The starting point.
`Y` |  | The starting point.
`Color` |  | The area or boundary color, depending on FillStyle.
`FillStyle` |  | fsBorder or fsSurface.
`Brush` |  | The brush used to fill the area.

## Function result

False on failure.

## Description

FillStyle specifies the area:

- When FillStyle is fsBorder, the area is bounded by a certain Color, the boundary must not have gaps in it.
- When FillStyle is fsSurface, the area has the specified Color, and all adjacent pixels of this color are replaced.

Filling starts at a given point, which resides somewhere inside the area.