PathSegment Struct

An element of a VectorPath, as VectorPath.EnumerateSegments gives it: the start of a contour, a straight segment, a Bézier curve, an arc of an ellipse, or the end of a closed contour.

public readonly struct PathSegment : IEquatable<PathSegment>

Remarks

Each kind is what the method of the same name of VectorPathBuilder adds, with the same values: a path can be built again from its segments.

Implements

Properties

NameDescription
Control1Gets the control point of a quadratic Bézier curve, or the first control point of a cubic one.
Control2Gets the second control point of a cubic Bézier curve.
IsClockwiseGets a value indicating whether an arc turns clockwise on the image.
IsLargeArcGets a value indicating whether an arc is more than half a turn.
KindGets what the segment adds to the path.
PointGets the point the segment ends at: the first point of the contour for PathSegmentKind.MoveTo and for PathSegmentKind.Close.
RadiusXGets the first radius of the ellipse of an arc.
RadiusYGets the second radius of the ellipse of an arc.
RotationGets the angle of the first radius of the ellipse of an arc, in degrees from the x axis, clockwise on the image.

Gets the control point of a quadratic Bézier curve, or the first control point of a cubic one.

public PointD Control1 { get; }

Property value

PointD

Gets the second control point of a cubic Bézier curve.

public PointD Control2 { get; }

Property value

PointD

IsClockwise

PathSegment.cs

Gets a value indicating whether an arc turns clockwise on the image.

public bool IsClockwise { get; }

Property value

bool

IsLargeArc

PathSegment.cs

Gets a value indicating whether an arc is more than half a turn.

public bool IsLargeArc { get; }

Property value

bool

Gets what the segment adds to the path.

public PathSegmentKind Kind { get; }

Property value

PathSegmentKind

Gets the point the segment ends at: the first point of the contour for PathSegmentKind.MoveTo and for PathSegmentKind.Close.

public PointD Point { get; }

Property value

PointD

Gets the first radius of the ellipse of an arc.

public double RadiusX { get; }

Property value

double

Gets the second radius of the ellipse of an arc.

public double RadiusY { get; }

Property value

double

Gets the angle of the first radius of the ellipse of an arc, in degrees from the x axis, clockwise on the image.

public double Rotation { get; }

Property value

double

Methods

NameDescription
Equals(PathSegment)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
GetHashCode()Returns the hash code for this instance.
ToString()Returns the segment as a command of SVG path data, with absolute coordinates.

Equals overloads

Equals(PathSegment)

PathSegment.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PathSegment other)
Parameters
other PathSegment
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

PathSegment.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

PathSegment.cs

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

ToString()

PathSegment.cs

Returns the segment as a command of SVG path data, with absolute coordinates.

public override string ToString()

Returns

string A culture-invariant string.

Operators

NameDescription
operator ==(PathSegment, PathSegment)Compares two segments for equality.
operator !=(PathSegment, PathSegment)Compares two segments for inequality.

operator ==(PathSegment, PathSegment)

PathSegment.cs

Compares two segments for equality.

public static bool operator ==(PathSegment left, PathSegment right)

Parameters

left PathSegment
The first segment.
right PathSegment
The second segment.

Returns

bool true if every value is equal; otherwise false.

operator !=(PathSegment, PathSegment)

PathSegment.cs

Compares two segments for inequality.

public static bool operator !=(PathSegment left, PathSegment right)

Parameters

left PathSegment
The first segment.
right PathSegment
The second segment.

Returns

bool true if a value differs; otherwise false.