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 : ImmutableObject, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IImmutableObject, IDisposableObject, IDisposable, IBaseObject, IEquatable<Pen>
Inheritance
Pen
Implements
Extension Methods

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, float)

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

Pen(Color, float, DashStyle)

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

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

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

Pen(Color, float, DashStyle, LineCap, LineJoin, bool)

Initializes a new instance of the Pen class with the specified color, width, dash style, line cap, and line join settings.

Fields

DashPatterns

Gets or sets the dash patterns for dashed lines. Change this property to customize the dash pattern of the pen which is specified by the DashStyle property.

Properties

AsBrush

Gets SolidBrush with Color of this pen. Uses AsBrush internally.

Color

Gets or sets the color of this Pen.

DashPattern

Gets or sets the dash pattern 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.

PenInfo

Gets pen information as a single record. This record contains all the properties of the pen.

SkiaPaint

Gets this pen as SKPaint.

Width

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

Methods

DisposeManaged()

Override to dispose managed resources. Here we dispose all used object references.

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.

ResetCachedResources()

Resets cached resource instances.

ToString()

Returns a string that represents the current object.

UpdateRequired()

This method is called when the pen properties are changed, and it can be overridden in derived classes to perform custom actions when the pen properties change.

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.