Pen

System.Drawing.Pen

Namespace: System.Drawing

Assembly: System.Drawing.Managed (4.0.0.0)

Defines an object used to draw lines and curves. This class cannot be inherited.

public class Pen : MarshalByRefObject, ICloneable, IDisposable

Constructors

Pen(brush)

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

Name
Type
Description

brush

A Brush that determines the characteristics of this Pen.

Throws:

Pen(color)

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

Name
Type
Description

color

A Color structure that indicates the color of this Pen.

Pen(brush, width)

Initializes a new instance of the Pen class with the specified.Color.

Name
Type
Description

brush

A Brush that determines the fill properties of this Pen.

width

The width of the Pen.

Throws:

Pen(color, width)

Initializes a new instance of the Pen class with the specified.Color.

Name
Type
Description

color

The color of this pen.

width

The width of the Pen.

Properties

Alignment

PenAlignment: Gets or sets a PenAlignment that represents the alignment for this Pen.

Brush

Brush: Gets or sets the Brush that determines attributes of this Pen.

Color

Color: Gets or sets the color of this Pen.

DashOffset

Single: Gets or sets the distance from the start of a line to the beginning of a dash pattern.

DashPattern

Single[]: Gets or sets an array of custom dashes and spaces.

DashStyle

DashStyle: Gets or sets the style used for dashed lines drawn with this Pen.

EndCap

LineCap: Gets or sets the cap style used at the end of lines drawn with this Pen.

LineJoin

LineJoin: Gets or sets the join style for the ends of two overlapping lines drawn with this Pen.

MiterLimit

Single: Gets or sets the limit of the thickness of the join on a mitered corner.

PenType

PenType: Gets the style of lines drawn with this Pen.

Transform

Matrix: Gets or sets a copy of the geometric transformation for this Pen.

Width

Single: Gets or sets the width of this Pen, in units of the Graphics object used for drawing.

Methods

Clone()

Returns: Object.

Dispose()

Finalize()

Finalizes an instance of the Pen class.

Last updated

Was this helpful?