Share via


DrawingAttributes.DrawingAttributes Constructor

DrawingAttributes.DrawingAttributes Constructor

Initializes a new instance of the DrawingAttributes class.

Definition

Visual Basic .NET Public Sub DrawingAttributes( _
ByVal pen As Pen _
)
C# public DrawingAttributes(
Pen pen
);
Managed C++ public: DrawingAttributes(
Pen *pen
);

Parameters

pen System.Drawing.Pen. The Pen Leave Site object from which the pen color and width for the DrawingAttributes object is taken.

Examples

[C#]

This C# example initializes a new instance of the DrawingAttributes class, theDrawingAttributes, with the Color and Width properties set to those of a pen, thickRedPen.

Pen thickRedPen = new Pen(Color.Red, 200);
DrawingAttributes theDrawingAttributes = new DrawingAttributes(thickRedPen);
                

[VB.NET]

This Microsoft® Visual Basic® .NET example initializes a new instance of the DrawingAttributes class, theDrawingAttributes, with the Width and Width properties set to those of a pen, thickRedPen.

Dim thickRedPen As New Pen(Color.Red, 200)
Dim theDrawingAttributes As New DrawingAttributes(thickRedPen)
                

See Also