---
title: "GdiGraphics..::.FloodFill Method (PointF, Brush, Color, FloodFillMode, Single)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_GdiGraphics_FloodFill_5_ba0927e0.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# GdiGraphics.FloodFill Method (PointF, Brush, Color, FloodFillMode, Single)
 
Fills an area of the display surface with the specified brush starting from specified point.
 
**Namespace:** [Aurigma.GraphicsMill.Drawing](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub FloodFill ( _point As PointF, _brush As Brush, _targetColor As Color, _mode As FloodFillMode, _tolerance As Single _
)
```
 
```csharp
public void FloodFill(PointF point,Brush brush,Color targetColor,FloodFillMode mode,float tolerance
)
```
 
### Parameters
 
 - point
     - Type: [System.Drawing.PointF](http://msdn2.microsoft.com/en-us/ckys1c1e)
 [PointF](http://msdn2.microsoft.com/en-us/ckys1c1e) structure specifying the point to start filling from.

 - brush
     - Type: [Aurigma.GraphicsMill.Drawing.Brush](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_Brush.htm.md)
 [Brush](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_Brush.htm.md) class instance used to fill the surface. Currently only [SolidBrush](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_SolidBrush.htm.md) is supported.

 - targetColor
     - Type: [Aurigma.GraphicsMill.Color](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Color.htm.md)
The [Color](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Color.htm.md) which is used to determine the filling area boundaries. The method behaviour depends on *mode* argument value. If *mode* is [UntilColor](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFillMode.htm.md), this is a boundary color (when algorithm meets this color, it stops filling). If *mode* is [TillColor](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFillMode.htm.md), this is a surface color (algorithm continue filling till current color is the same as target color).

 - mode
     - Type: [Aurigma.GraphicsMill.Transforms.FloodFillMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFillMode.htm.md)
 [FloodFillMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_FloodFillMode.htm.md) value specifying how to determine the filling area boundary (see comments for *targetColor*).

 - tolerance
     - Type: [System.Single](http://msdn2.microsoft.com/en-us/3www918f)
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](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md) which is associated with [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md). If you try to apply it at [GdiGraphics](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md) associated with device context, method will throw an exception.
   
## See Also

### Reference

- [GdiGraphics Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md)
- [FloodFill Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_FloodFill.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
