Skip to main content

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

Instance member Pen(brush)

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

NameTypeDescription
brushBrushA Brush that determines the characteristics of this Pen.

Throws:

Instance member Pen(color)

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

NameTypeDescription
colorColorA Color structure that indicates the color of this Pen.

Instance member Pen(brush, width)

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

NameTypeDescription
brushBrushA Brush that determines the fill properties of this Pen.
widthSingleThe width of the Pen.

Throws:

Instance member Pen(color, width)

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

NameTypeDescription
colorColorThe color of this pen.
widthSingleThe width of the Pen.

Properties

Instance member Alignment

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

Instance member Brush

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

Instance member Color

Color: Gets or sets the color of this Pen.

Instance member DashOffset

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

Instance member DashPattern

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

Instance member DashStyle

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

Instance member EndCap

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

Instance member LineJoin

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

Instance member MiterLimit

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

Instance member PenType

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

Instance member Transform

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

Instance member Width

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

Methods

Instance member Clone()

Returns: Object.

Instance member Dispose()

Protected member Finalize()

Finalizes an instance of the Pen class.