Vcl.Graphics.TCanvas.FloodFill

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure FloodFill(X, Y: Integer; Color: TColor; FillStyle: TFillStyle); override;

C++

virtual void __fastcall FloodFill(int X, int Y, System::Uitypes::TColor Color, TFillStyle FillStyle);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.Graphics.pas
Vcl.Graphics.hpp
Vcl.Graphics TCanvas

Description

Fills an area of the canvas using the current brush.

Use FloodFill to fill a possibly non-rectangular region of the image with the value of Brush. The boundaries of the region to be filled are determined by moving outward from the point (X,Y) until a color boundary involving the Color parameter is encountered.

X and X are the coordinates on the canvas where filling starts.

Color is the color that defines the boundary of the region to fill. Its interpretation depends on the value of FillStyle.

FillStyle specifies whether the region is defined by all pixels with the same value as Color, or all points with a different value.

Tip: Use the Pixels property to get the exact value of the color at the point (X,Y) when using a FillStyle of fsSurface. Similarly, when FillStyle is fsBorder, use Pixels to get the exact value of the boundary color if a point on the boundary is known.

See Also

Code Examples