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

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

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)

Syntax

Visual Basic
Public Sub FloodFill ( _
	point As Point, _
	brush As Brush, _
	targetColor As Color, _
	mode As FloodFillMode, _
	tolerance As Single _
)
C#
public void FloodFill(
	Point point,
	Brush brush,
	Color targetColor,
	FloodFillMode mode,
	float tolerance
)

Parameters

point

Type: System.Drawing.Point

Point structure specifying the point to start filling from.
brush

Type: Aurigma.GraphicsMill.Drawing.Brush

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

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).
mode

Type: Aurigma.GraphicsMill.Transforms.FloodFillMode

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

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.

Remarks

Note

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

Reference