Table of Contents

Class Pen

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

Defines an object used to draw lines and curves.

public class Pen : HandledObject<IPenHandler>, IBaseObject, IDisposableObject, IDisposable, INotifyPropertyChanged, IEquatable<Pen>
Inheritance
Pen
Implements

Remarks

A Pen draws a line of specified width and style. Use the DashStyle property to draw several varieties of dashed lines.

Constructors

Pen(Brush)

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

Pen(Color)

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

Pen(Color, double)

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

Pen(Color, double, DashStyle)

Initializes a new instance of the Pen class with the specified Color, Width and DashStyle properties.

Pen(Color, double, DashStyle, LineCap, LineJoin)

Initializes a new instance of the Pen class with the specified Color, Width and DashStyle properties.

Properties

AsBrush

Creates SolidBrush with Color of this pen.

Color

Gets or sets the color of this Pen.

DashStyle

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

Default

Gets the default pen.

LineCap

Specifies the available cap styles with which a Pen object can end a line.

LineJoin

Specifies how to join consecutive line or curve segments.

SkiaPaint

Gets this pen as SKPaint.

UpdateRequired

Gets whether handler update is required.

Width

Gets or sets the width of this Pen, in device-independent units.

Methods

CreateHandler()

Creates native pen.

Equals(Pen?)

Indicates whether the current object is equal to another object of the same type.

Equals(object?)

Determines whether the specified object is equal to the current object.

GetHashCode()

Serves as the default hash function.

ToString()

Returns a string that represents the current object.

UpdateHandler()

Updates native pen.

Operators

operator ==(Pen?, Pen?)

Returns a value that indicates whether the two objects are equal.

implicit operator SKPaint(Pen)

Converts the specified Pen to a SKPaint.

operator !=(Pen?, Pen?)

Returns a value that indicates whether the two objects are not equal.