Pen Class
Definition
Describes how a stroke is drawn.
public class Pen
Constructors
| Name | Description |
|---|---|
| Pen (3 overloads) | Initializes a new instance of the Avalonia.Media.Pen class. |
Pen overloads
Pen Constructor
Initializes a new instance of the Avalonia.Media.Pen class.
public Pen()
Pen Constructor
Initializes a new instance of the Avalonia.Media.Pen class.
public Pen(Avalonia.Media.IBrush brush, double thickness, Avalonia.Media.IDashStyle dashStyle, Avalonia.Media.PenLineCap lineCap, Avalonia.Media.PenLineJoin lineJoin, double miterLimit)
Parameters
brush Avalonia.Media.IBrush
The brush used to draw.
thickness double
The stroke thickness.
dashStyle Avalonia.Media.IDashStyle
The dash style.
lineCap Avalonia.Media.PenLineCap
The line cap.
lineJoin Avalonia.Media.PenLineJoin
The line join.
miterLimit double
The miter limit.
Pen Constructor
Initializes a new instance of the Avalonia.Media.Pen class.
public Pen(uint color, double thickness, Avalonia.Media.IDashStyle dashStyle, Avalonia.Media.PenLineCap lineCap, Avalonia.Media.PenLineJoin lineJoin, double miterLimit)
Parameters
color uint
The stroke color.
thickness double
The stroke thickness.
dashStyle Avalonia.Media.IDashStyle
The dash style.
lineCap Avalonia.Media.PenLineCap
Specifies the type of graphic shape to use on both ends of a line.
lineJoin Avalonia.Media.PenLineJoin
The line join.
miterLimit double
The miter limit.
Methods
| Name | Description |
|---|---|
| ToImmutable | Creates an immutable clone of the brush. |
| Bind (8 overloads) | Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject. |
| CheckAccess | Returns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject. |
| ClearValue (4 overloads) | Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject. |
| CoerceValue | Coerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject. |
| Equals | Compares two objects using reference equality. Inherited from AvaloniaObject. |
| GetBaseValue | Inherited from AvaloniaObject. |
| GetHashCode | Gets the hash code for the object. Inherited from AvaloniaObject. |
| GetValue (3 overloads) | Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| IsAnimating | Checks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject. |
| IsSet | Checks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject. |
| SetCurrentValue (2 overloads) | Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject. |
| SetValue (3 overloads) | Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| VerifyAccess | Checks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject. |
ToImmutable Method
Creates an immutable clone of the brush.
public Avalonia.Media.Immutable.ImmutablePen ToImmutable()
Returns
Avalonia.Media.Immutable.ImmutablePen
The immutable clone.
Properties
| Name | Description |
|---|---|
| Brush | Gets or sets the brush used to draw the stroke. |
| DashStyle | Gets or sets the style of dashed lines drawn with a Avalonia.Media.Pen object. |
| LineCap | Gets or sets the type of shape to use on both ends of a line. |
| LineJoin | Gets or sets the join style for the ends of two consecutive lines drawn with this Avalonia.Media.Pen. |
| MiterLimit | Gets or sets the limit of the thickness of the join on a mitered corner. |
| Thickness | Gets or sets the stroke thickness. |
| Dispatcher | Returns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject. |
| Item | Inherited from AvaloniaObject. |
Brush Property
Gets or sets the brush used to draw the stroke.
public Avalonia.Media.IBrush Brush { get; set; }
DashStyle Property
Gets or sets the style of dashed lines drawn with a Avalonia.Media.Pen object.
public Avalonia.Media.IDashStyle DashStyle { get; set; }
LineCap Property
Gets or sets the type of shape to use on both ends of a line.
public Avalonia.Media.PenLineCap LineCap { get; set; }
LineJoin Property
Gets or sets the join style for the ends of two consecutive lines drawn with this Avalonia.Media.Pen.
public Avalonia.Media.PenLineJoin LineJoin { get; set; }
MiterLimit Property
Gets or sets the limit of the thickness of the join on a mitered corner.
public double MiterLimit { get; set; }
Thickness Property
Gets or sets the stroke thickness.
public double Thickness { get; set; }
Fields
| Name | Description |
|---|---|
| BrushProperty | Defines the Avalonia.Media.Pen.Brush property. |
| DashStyleProperty | Defines the Avalonia.Media.Pen.DashStyle property. |
| LineCapProperty | Defines the Avalonia.Media.Pen.LineCap property. |
| LineJoinProperty | Defines the Avalonia.Media.Pen.LineJoin property. |
| MiterLimitProperty | Defines the Avalonia.Media.Pen.MiterLimit property. |
| ThicknessProperty | Defines the Avalonia.Media.Pen.Thickness property. |
BrushProperty Field
Defines the Avalonia.Media.Pen.Brush property.
public Avalonia.StyledProperty<TValue><Avalonia.Media.IBrush> BrushProperty
DashStyleProperty Field
Defines the Avalonia.Media.Pen.DashStyle property.
public Avalonia.StyledProperty<TValue><Avalonia.Media.IDashStyle> DashStyleProperty
LineCapProperty Field
Defines the Avalonia.Media.Pen.LineCap property.
public Avalonia.StyledProperty<TValue><Avalonia.Media.PenLineCap> LineCapProperty
LineJoinProperty Field
Defines the Avalonia.Media.Pen.LineJoin property.
public Avalonia.StyledProperty<TValue><Avalonia.Media.PenLineJoin> LineJoinProperty
MiterLimitProperty Field
Defines the Avalonia.Media.Pen.MiterLimit property.
public Avalonia.StyledProperty<TValue><double> MiterLimitProperty
ThicknessProperty Field
Defines the Avalonia.Media.Pen.Thickness property.
public Avalonia.StyledProperty<TValue><double> ThicknessProperty
Events
| Name | Description |
|---|---|
| PropertyChanged | Raised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject. |