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

HatchBrush Class

This class represents a brush which fills the shape with predefined pattern.

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


Visual Basic
Public NotInheritable Class HatchBrush _
	Inherits Brush
public sealed class HatchBrush : Brush


Hatch brush is defined with three parameters: hatch style or pattern (HatchStyle property), foreground color, i.e. color of the pattern (ForegroundColor property), and background color (BackgroundColor property). Besides of this, you can disable background with TransparentBackground property. In this case only pattern will be drawing with foreground on the underlying image.

You can convert this brush instance into its analogue from System.Drawing namespace using method ToGdiplusBrush(), or appropriate cast operator.


Visual Basic
Dim bitmap As New Aurigma.GraphicsMill.Bitmap( _
 Aurigma.GraphicsMill.RgbColor.White, 185, 145, _

Dim graphics As Aurigma.GraphicsMill.Drawing.GdiGraphics = bitmap.GetGdiGraphics()

'Draw filled but non-outlined ellipse
Dim brush As New Aurigma.GraphicsMill.Drawing.HatchBrush
brush.ForegroundColor = Aurigma.GraphicsMill.RgbColor.Blue
brush.BackgroundColor = Aurigma.GraphicsMill.RgbColor.Yellow
brush.TransparentBackground = True
brush.HatchStyle = Aurigma.GraphicsMill.Drawing.HatchStyle.Cross

graphics.FillEllipse(brush, 60, 40, 100, 80)
Aurigma.GraphicsMill.Bitmap bitmap  = new Aurigma.GraphicsMill.Bitmap( 
    Aurigma.GraphicsMill.RgbColor.White, 185, 145, 

Aurigma.GraphicsMill.Drawing.GdiGraphics graphics = bitmap.GetGdiGraphics();

//Draw filled but non-outlined ellipse
Aurigma.GraphicsMill.Drawing.HatchBrush brush = 
    new Aurigma.GraphicsMill.Drawing.HatchBrush();
brush.ForegroundColor = Aurigma.GraphicsMill.RgbColor.Blue;
brush.BackgroundColor = Aurigma.GraphicsMill.RgbColor.Yellow;
brush.TransparentBackground = true;
brush.HatchStyle = Aurigma.GraphicsMill.Drawing.HatchStyle.Cross;

graphics.FillEllipse(brush, 60, 40, 100, 80);

Inheritance Hierarchy

L Aurigma.GraphicsMill.Drawing.Brush
L Aurigma.GraphicsMill.Drawing.HatchBrush

Thread Safety

Static members of this type are safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.

Object Model

See Also