Class PdfSubpath
A supbpath is made up of a sequence of connected segments.
public class PdfSubpath
- Inheritance
-
PdfSubpath
- Inherited Members
Constructors
PdfSubpath()
public PdfSubpath()
Properties
Commands
The sequence of commands which form this PdfSubpath.
public IReadOnlyList<PdfSubpath.IPathCommand> Commands { get; }
Property Value
IsClockwise
Return true if points are organised in a clockwise order. Works only with closed paths.
public bool IsClockwise { get; }
Property Value
IsCounterClockwise
Return true if points are organised in a counterclockwise order. Works only with closed paths.
public bool IsCounterClockwise { get; }
Property Value
IsDrawnAsRectangle
True if the PdfSubpath was originaly drawn using the rectangle ('re') operator.
Always false if paths are clipped.
public bool IsDrawnAsRectangle { get; }
Property Value
Methods
BezierCurveTo(double, double, double, double, double, double)
Add a PdfSubpath.BezierCurve to the path.
public void BezierCurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
Parameters
CloseSubpath()
Close the path.
public void CloseSubpath()
Equals(object)
Compares two PdfSubpaths for equality. Paths will only be considered equal if the commands which construct the paths are in the same order.
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetBoundingRectangle()
Gets a PdfRectangle which entirely contains the geometry of the defined subpath.
public PdfRectangle? GetBoundingRectangle()
Returns
- PdfRectangle?
For subpaths which don't define any geometry this returns null.
GetBoundingRectangle(IReadOnlyList<PdfSubpath>)
Gets a PdfRectangle which entirely contains the geometry of the defined path.
public static PdfRectangle? GetBoundingRectangle(IReadOnlyList<PdfSubpath> path)
Parameters
path
IReadOnlyList<PdfSubpath>
Returns
- PdfRectangle?
For paths which don't define any geometry this returns null.
GetCentroid()
Get the PdfSubpath's centroid point.
public PdfPoint GetCentroid()
Returns
GetDrawnRectangle()
If IsDrawnAsRectangle then returns the rectangle dimensions specified. Otherwise returns null.
public PdfRectangle? GetDrawnRectangle()
Returns
Remarks
Since a rectangle is interpreted as a move command followed by 3 lines and a close command this condenses the 5 commands back into a single rectangle.
GetHashCode()
Get the hash code. Paths will only have the same hash code if the commands which construct the paths are in the same order.
public override int GetHashCode()
Returns
IsClosed()
Determines if the path is currently closed.
public bool IsClosed()
Returns
LineTo(double, double)
Add a PdfSubpath.Line command to the path.
public void LineTo(double x, double y)
Parameters
MoveTo(double, double)
Add a PdfSubpath.Move command to the path.
public void MoveTo(double x, double y)
Parameters
Rectangle(double, double, double, double)
Add a rectangle following the pdf specification (m, l, l, l, c) path. A new subpath is created.
public void Rectangle(double x, double y, double width, double height)