Class RenderPen
Defines an object used to draw lines and curves. This class cannot be inherited.
public sealed class RenderPen
- Inheritance
-
objectRenderPen
- Extension Methods
Constructors
RenderPen(Color)
Initializes a new instance of the OFT.Rendering.Pen class with the specified color.
public RenderPen(Color color)
Parameters
colorColorA System.Drawing.Color structure that indicates the color of this OFT.Rendering.Pen.
RenderPen(Color, DashStyle)
Initializes a new pen of width 1 with the specified color and dash style.
public RenderPen(Color color, DashStyle dashStyle)
Parameters
colorColorPen color.
dashStyleDashStyleDash style of the lines.
RenderPen(Color, float)
Initializes a new instance of the OFT.Rendering.Pen class with the specified System.Drawing.Color and OFT.Rendering.Pen.Width properties.
public RenderPen(Color color, float width)
Parameters
colorColorA System.Drawing.Color structure that indicates the color of this OFT.Rendering.Pen.
widthfloatA value indicating the width of this OFT.Rendering.Pen.
RenderPen(Color, float, DashStyle)
Initializes a new pen with the specified color, width and dash style.
public RenderPen(Color color, float width, DashStyle dashStyle)
Parameters
colorColorPen color.
widthfloatPen width; must be positive.
dashStyleDashStyleDash style of the lines.
Exceptions
- ArgumentOutOfRangeException
widthis zero or negative.
Properties
Color
Gets or sets the color of this OFT.Rendering.Pen.
public Color Color { get; }
Property Value
- Color
A System.Drawing.Color structure that represents the color of this OFT.Rendering.Pen.
CustomEndCap
Gets or sets a custom cap to use at the end of lines drawn with this OFT.Rendering.RenderPen.
public RenderAdjustableArrowCap? CustomEndCap { get; set; }
Property Value
- RenderAdjustableArrowCap
A OFT.Rendering.RenderCustomLineCap that represents the cap used at the end of lines drawn with this OFT.Rendering.RenderPen.
CustomStartCap
Gets or sets a custom cap to use at the beginning of lines drawn with this OFT.Rendering.RenderPen.
public RenderAdjustableArrowCap? CustomStartCap { get; set; }
Property Value
- RenderAdjustableArrowCap
A OFT.Rendering.RenderCustomLineCap that represents the cap used at the beginning of lines drawn with this OFT.Rendering.RenderPen.
DashPattern
Gets or sets an array of custom dashes and spaces.
public float[]? DashPattern { get; set; }
Property Value
- float[]
An array of real numbers that specifies the lengths of alternating dashes and spaces in dashed lines.
DashStyle
Gets or sets the style used for dashed lines drawn with this OFT.Rendering.RenderPen.
public DashStyle DashStyle { get; set; }
Property Value
- DashStyle
A OFT.Rendering.DashStyle that represents the style used for dashed lines drawn with this OFT.Rendering.RenderPen.
Width
Gets or sets the width of this OFT.Rendering.Pen, in units of the OFT.Rendering.Graphics object used for drawing.
public float Width { get; set; }
Property Value
- float
The width of this OFT.Rendering.Pen.
Methods
Equals(RenderPen?)
Determines whether other draws the same lines: equal color and dash style, widths that differ by less than 0.1,
and equal dash pattern and caps. A cap or dash pattern that is null on this pen is not compared.
public bool Equals(RenderPen? other)
Parameters
otherRenderPenPen to compare with.
Returns
Equals(object?)
Determines whether obj is a RenderPen equal to this pen; see Equals(RenderPen?).
Added in ATAS 8.0.15.
public override bool Equals(object? obj)
Parameters
objobjectObject to compare with.
Returns
- bool
true when the pens are equal.
GetHashCode()
Returns a hash code computed from the color, dash style, width rounded to one decimal place, caps and dash pattern.
Added in ATAS 8.0.15.
public override int GetHashCode()
Returns
- int
The hash code.