Class Pen
Provides a pen that can apply a pattern to a line with a set brush and thickness
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Drawing.Processing
Assembly: SixLabors.ImageSharp.Drawing.dll
Syntax
public class Pen : IPen
Remarks
The pattern will be in to the form of new float[]{ 1f, 2f, 0.5f} this will be converted into a pattern that is 3.5 times longer that the width with 3 sections section 1 will be width long (making a square) and will be filled by the brush section 2 will be width * 2 long and will be empty section 3 will be width/2 long and will be filled the pattern will immediately repeat without gap.
Constructors
| Improve this Doc View SourcePen(Color, Single)
Initializes a new instance of the Pen class.
Declaration
public Pen(Color color, float width)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color. |
Single | width | The width. |
Pen(Color, Single, Single[])
Initializes a new instance of the Pen class.
Declaration
public Pen(Color color, float width, float[] pattern)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color. |
Single | width | The width. |
Single[] | pattern | The pattern. |
Pen(IBrush, Single)
Initializes a new instance of the Pen class.
Declaration
public Pen(IBrush brush, float width)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | The brush. |
Single | width | The width. |
Pen(IBrush, Single, Single[])
Initializes a new instance of the Pen class.
Declaration
public Pen(IBrush brush, float width, float[] pattern)
Parameters
Type | Name | Description |
---|---|---|
IBrush | brush | The brush. |
Single | width | The width. |
Single[] | pattern | The pattern. |
Properties
| Improve this Doc View SourceStrokeFill
Gets the stroke fill.
Declaration
public IBrush StrokeFill { get; }
Property Value
Type | Description |
---|---|
IBrush |
StrokePattern
Gets the stoke pattern.
Declaration
public ReadOnlySpan<float> StrokePattern { get; }
Property Value
Type | Description |
---|---|
ReadOnlySpan<Single> |
StrokeWidth
Gets the width to apply to the stroke
Declaration
public float StrokeWidth { get; }
Property Value
Type | Description |
---|---|
Single |