This documentation is for the old version. Go to the latest Graphics Mill docs

GdiGraphics.FloodFill Method (Point, Brush, Color, FloodFillMode, Single, Boolean, Boolean)

Fills an area of the display surface with the specified brush starting from specified point.

Namespace: Aurigma.GraphicsMill.Drawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)


Visual Basic
Public Sub FloodFill ( _
	point As Point, _
	brush As Brush, _
	targetColor As Color, _
	mode As FloodFillMode, _
	tolerance As Single, _
	preserveAlpha As Boolean, _
	processHalftones As Boolean _
public void FloodFill(
	Point point,
	Brush brush,
	Color targetColor,
	FloodFillMode mode,
	float tolerance,
	bool preserveAlpha,
	bool processHalftones



Type: System.Drawing.Point

Point structure specifying the point to start filling from.

Type: Aurigma.GraphicsMill.Drawing.Brush

Brush class instance used to fill the surface. Currently only SolidBrush is supported.

Type: Aurigma.GraphicsMill.Color

The Color which is used to determine the filling area boundaries. The method behaviour depends on mode argument value. If mode is UntilColor, this is a boundary color (when algorithm meets this color, it stops filling). If mode is TillColor, this is a surface color (algorithm continue filling till current color is the same as target color).

Type: Aurigma.GraphicsMill.Transforms.FloodFillMode

FloodFillMode value specifying how to determine the filling area boundary (see comments for targetColor).

Type: System.Single

Value in range [0, 1] specifying admissible tolerance (distance between colors in color space) when comparing current color and target color (see comments for targetColor). Minimum value (0) means exact match of the colors, maximum value (1) means that any color matches.

Type: System.Boolean

Value specifying if to preserve alpha channel. If true, alpha channel will not be overwritten by the colors defined by filling brush.

Type: System.Boolean

Value specifying how to handle situations when current color does not exactly match target color, but tolerant to it (with specified tolerance). If false, this pixel is replaced with brush color, if true, it is alpha-blended (alpha is calculated as 1 - T, where T is actual tolerance between these colors).



Flood fill can be applied only at GdiGraphics which is associated with Bitmap. If you try to apply it at GdiGraphics associated with device context, method will throw an exception.

See Also