Class ArcLineSegment
- Namespace
- SixLabors.ImageSharp.Drawing
- Assembly
- SixLabors.ImageSharp.Drawing.dll
Represents a line segment that contains radii and angles that will be rendered as a elliptical arc.
public class ArcLineSegment : ILineSegment
- Inheritance
-
ArcLineSegment
- Implements
- Inherited Members
Constructors
ArcLineSegment(PointF, PointF, SizeF, float, bool, bool)
Initializes a new instance of the ArcLineSegment class.
public ArcLineSegment(PointF from, PointF to, SizeF radius, float rotation, bool largeArc, bool sweep)
Parameters
fromPointFThe absolute coordinates of the current point on the path.
toPointFThe absolute coordinates of the final point of the arc.
radiusSizeFThe radii of the ellipse (also known as its semi-major and semi-minor axes).
rotationfloatThe angle, in degrees, from the x-axis of the current coordinate system to the x-axis of the ellipse.
largeArcboolThe large arc flag, and is false if an arc spanning less than or equal to 180 degrees is chosen, or true if an arc spanning greater than 180 degrees is chosen.
sweepboolThe sweep flag, and is false if the line joining center to arc sweeps through decreasing angles, or true if it sweeps through increasing angles.
ArcLineSegment(PointF, SizeF, float, float, float)
Initializes a new instance of the ArcLineSegment class.
public ArcLineSegment(PointF center, SizeF radius, float rotation, float startAngle, float sweepAngle)
Parameters
centerPointFThe coordinates of the center of the ellipse.
radiusSizeFThe radii of the ellipse (also known as its semi-major and semi-minor axes).
rotationfloatThe angle, in degrees, from the x-axis of the current coordinate system to the x-axis of the ellipse.
startAnglefloatThe start angle of the elliptical arc prior to the stretch and rotate operations. (0 is at the 3 o'clock position of the arc's circle).
sweepAnglefloatThe angle between
startAngleand the end of the arc.
Properties
Bounds
Gets the bounds of the linearized segment output.
public RectangleF Bounds { get; }
Property Value
EndPoint
Gets the end point.
public PointF EndPoint { get; }
Property Value
- PointF
The end point.
StartPoint
Gets the start point.
public PointF StartPoint { get; }
Property Value
Methods
CopyTo(Span<PointF>, bool, Vector2)
Writes the segment's linearized points to destination, baked at the supplied
device-space scale.
public void CopyTo(Span<PointF> destination, bool skipFirstPoint, Vector2 scale)
Parameters
destinationSpan<PointF>The destination point span.
skipFirstPointboolWhether to skip the first emitted point.
scaleVector2The X/Y scale at which curves are flattened. Pass One for local-space output.
LinearVertexCount(Vector2)
Returns the number of linear vertices emitted by this segment when flattened under the supplied
device-space scale.
public int LinearVertexCount(Vector2 scale)
Parameters
Returns
- int
The number of linear vertices this segment emits.
Transform(Matrix4x4)
Transforms the current ArcLineSegment using specified matrix.
public ILineSegment Transform(Matrix4x4 matrix)
Parameters
matrixMatrix4x4The transformation matrix.
Returns
- ILineSegment
An ArcLineSegment with the matrix applied to it.