Table of Contents

Class ImmutablePen

Namespace
Avalonia.Media.Immutable
Assembly
Avalonia.Base.dll

Describes how a stroke is drawn.

public class ImmutablePen : IPen, IEquatable<IPen>
Inheritance
ImmutablePen
Implements
Inherited Members
Extension Methods

Constructors

ImmutablePen(IImmutableBrush?, double, ImmutableDashStyle?, PenLineCap, PenLineJoin, double)

Initializes a new instance of the Pen class.

public ImmutablePen(IImmutableBrush? brush, double thickness = 1, ImmutableDashStyle? dashStyle = null, PenLineCap lineCap = PenLineCap.Flat, PenLineJoin lineJoin = PenLineJoin.Miter, double miterLimit = 10)

Parameters

brush IImmutableBrush

The brush used to draw.

thickness double

The stroke thickness.

dashStyle ImmutableDashStyle

The dash style.

lineCap PenLineCap

The line cap.

lineJoin PenLineJoin

The line join.

miterLimit double

The miter limit.

ImmutablePen(uint, double, ImmutableDashStyle?, PenLineCap, PenLineJoin, double)

Initializes a new instance of the Pen class.

public ImmutablePen(uint color, double thickness = 1, ImmutableDashStyle? dashStyle = null, PenLineCap lineCap = PenLineCap.Flat, PenLineJoin lineJoin = PenLineJoin.Miter, double miterLimit = 10)

Parameters

color uint

The stroke color.

thickness double

The stroke thickness.

dashStyle ImmutableDashStyle

The dash style.

lineCap PenLineCap

Specifies the type of graphic shape to use on both ends of a line.

lineJoin PenLineJoin

The line join.

miterLimit double

The miter limit.

Properties

Brush

Gets the brush used to draw the stroke.

public IBrush? Brush { get; }

Property Value

IBrush

DashStyle

Specifies the style of dashed lines drawn with a Pen object.

public IDashStyle? DashStyle { get; }

Property Value

IDashStyle

LineCap

Specifies the type of graphic shape to use on both ends of a line.

public PenLineCap LineCap { get; }

Property Value

PenLineCap

LineJoin

Specifies how to join consecutive line or curve segments in a PathFigure (subpaths) contained in a PathGeometry object.

public PenLineJoin LineJoin { get; }

Property Value

PenLineJoin

MiterLimit

The limit on the ratio of the miter length to half this pen's Thickness.

public double MiterLimit { get; }

Property Value

double

Thickness

Gets the stroke thickness.

public double Thickness { get; }

Property Value

double

Methods

Equals(IPen?)

public bool Equals(IPen? other)

Parameters

other IPen

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int