Pen Constructors

Definition

Initializes a new instance of the Pen class.

Overloads

Pen()

Initializes a new instance of the Pen class.

Pen(Brush, Double)

Initializes a new instance of the Pen class with the specified Brush and thickness.

Pen()

Initializes a new instance of the Pen class.

C#
public Pen();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Pen(Brush, Double)

Initializes a new instance of the Pen class with the specified Brush and thickness.

C#
public Pen(System.Windows.Media.Brush brush, double thickness);

Parameters

brush
Brush

The Brush for this Pen.

thickness
Double

The thickness of the Pen.

Remarks

Thickness is relative to the geometry of the shape associated with this pen.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10