Struct PathSegment
A single segment of a path subpath (spec §8.5.2).
Contains a start point, optional control points, and an end point.
Assembly: DRIT.Pdf.dll
Syntax
public readonly struct PathSegment : IEquatable<PathSegment>
Properties
ControlPoint1
Gets the first Bezier control point (only for BezierCurve).
Declaration
public PdfPoint? ControlPoint1 { get; }
Property Value
ControlPoint2
Gets the second Bezier control point (only for BezierCurve).
Declaration
public PdfPoint? ControlPoint2 { get; }
Property Value
End
Gets the end point of the segment.
Declaration
public PdfPoint End { get; }
Property Value
Start
Gets the start point of the segment.
Declaration
public PdfPoint Start { get; }
Property Value
Type
Gets the type of this segment.
Declaration
public PathSegmentType Type { get; }
Property Value
Methods
BezierCurve(PdfPoint, PdfPoint, PdfPoint, PdfPoint)
Creates a cubic Bezier curve segment.
Declaration
public static PathSegment BezierCurve(PdfPoint start, PdfPoint cp1, PdfPoint cp2, PdfPoint end)
Parameters
Returns
Close(PdfPoint)
Creates a close-subpath segment.
Declaration
public static PathSegment Close(PdfPoint point)
Parameters
Returns
Equals(PathSegment)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(PathSegment other)
Parameters
| Type |
Name |
Description |
| PathSegment |
other |
An object to compare with this object.
|
Returns
| Type |
Description |
| bool |
true if the current object is equal to the other parameter; otherwise, false.
|
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
The object to compare with the current instance.
|
Returns
| Type |
Description |
| bool |
true if obj and this instance are the same type and represent the same value; otherwise, false.
|
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| int |
A 32-bit signed integer that is the hash code for this instance.
|
Overrides
Line(PdfPoint, PdfPoint)
Creates a line segment from start to end.
Declaration
public static PathSegment Line(PdfPoint start, PdfPoint end)
Parameters
Returns
MoveTo(PdfPoint)
Creates a move-to segment.
Declaration
public static PathSegment MoveTo(PdfPoint point)
Parameters
Returns
Rectangle(PdfPoint, PdfSize)
Creates a rectangle segment.
Declaration
public static PathSegment Rectangle(PdfPoint bottomLeft, PdfSize size)
Parameters
Returns
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
| Type |
Description |
| string |
The fully qualified type name.
|
Overrides
Transform(PdfMatrix)
Transform this segment by the given matrix.
Declaration
public PathSegment Transform(PdfMatrix matrix)
Parameters
Returns
Operators
operator ==(PathSegment, PathSegment)
Declaration
public static bool operator ==(PathSegment a, PathSegment b)
Parameters
Returns
operator !=(PathSegment, PathSegment)
Declaration
public static bool operator !=(PathSegment a, PathSegment b)
Parameters
Returns
Implements