Class Pen
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.
- DashPattern
Gets or sets the dash pattern of this Pen.
- Default
Gets the default pen.
- 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.
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.
- operator !=(Pen?, Pen?)
Returns a value that indicates whether the two objects are not equal.