HatchBrush Constructors

Definition

Initializes a new instance of the HatchBrush class with the specified HatchStyle enumeration and foreground color.

Overloads

HatchBrush(HatchStyle, Color)

Initializes a new instance of the HatchBrush class with the specified HatchStyle enumeration and foreground color.

HatchBrush(HatchStyle, Color, Color)

Initializes a new instance of the HatchBrush class with the specified HatchStyle enumeration, foreground color, and background color.

HatchBrush(HatchStyle, Color)

Source:
HatchBrush.cs
Source:
HatchBrush.cs
Source:
HatchBrush.cs
Source:
HatchBrush.cs
Source:
HatchBrush.cs

Initializes a new instance of the HatchBrush class with the specified HatchStyle enumeration and foreground color.

public HatchBrush (System.Drawing.Drawing2D.HatchStyle hatchstyle, System.Drawing.Color foreColor);

Parameters

hatchstyle
HatchStyle

One of the HatchStyle values that represents the pattern drawn by this HatchBrush.

foreColor
Color

The Color structure that represents the color of lines drawn by this HatchBrush.

Remarks

The background color is initialized to black.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

HatchBrush(HatchStyle, Color, Color)

Source:
HatchBrush.cs
Source:
HatchBrush.cs
Source:
HatchBrush.cs
Source:
HatchBrush.cs
Source:
HatchBrush.cs

Initializes a new instance of the HatchBrush class with the specified HatchStyle enumeration, foreground color, and background color.

public HatchBrush (System.Drawing.Drawing2D.HatchStyle hatchstyle, System.Drawing.Color foreColor, System.Drawing.Color backColor);

Parameters

hatchstyle
HatchStyle

One of the HatchStyle values that represents the pattern drawn by this HatchBrush.

foreColor
Color

The Color structure that represents the color of lines drawn by this HatchBrush.

backColor
Color

The Color structure that represents the color of spaces between the lines drawn by this HatchBrush.

Examples

The following example shows how to use the HatchBrush to create the HatchBrush shown in the previous illustration.

HatchBrush hBrush = new HatchBrush(
   HatchStyle.Horizontal,
   Color.Red,
   Color.FromArgb(255, 128, 255, 255));
e.Graphics.FillEllipse(hBrush, 0, 0, 100, 60);

Remarks

The following illustration shows an ellipse filled with a horizontal hatch pattern.

Hatch Pattern

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9