• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Struct PathSegment

A single segment of a path subpath (spec §8.5.2). Contains a start point, optional control points, and an end point.

Implements
IEquatable<PathSegment>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
Namespace: DRIT.Pdf.Content
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
Type Description
PdfPoint?

ControlPoint2

Gets the second Bezier control point (only for BezierCurve).

Declaration
public PdfPoint? ControlPoint2 { get; }
Property Value
Type Description
PdfPoint?

End

Gets the end point of the segment.

Declaration
public PdfPoint End { get; }
Property Value
Type Description
PdfPoint

Start

Gets the start point of the segment.

Declaration
public PdfPoint Start { get; }
Property Value
Type Description
PdfPoint

Type

Gets the type of this segment.

Declaration
public PathSegmentType Type { get; }
Property Value
Type Description
PathSegmentType

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
Type Name Description
PdfPoint start
PdfPoint cp1
PdfPoint cp2
PdfPoint end
Returns
Type Description
PathSegment

Close(PdfPoint)

Creates a close-subpath segment.

Declaration
public static PathSegment Close(PdfPoint point)
Parameters
Type Name Description
PdfPoint point
Returns
Type Description
PathSegment

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
ValueType.Equals(object)

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
ValueType.GetHashCode()

Line(PdfPoint, PdfPoint)

Creates a line segment from start to end.

Declaration
public static PathSegment Line(PdfPoint start, PdfPoint end)
Parameters
Type Name Description
PdfPoint start
PdfPoint end
Returns
Type Description
PathSegment

MoveTo(PdfPoint)

Creates a move-to segment.

Declaration
public static PathSegment MoveTo(PdfPoint point)
Parameters
Type Name Description
PdfPoint point
Returns
Type Description
PathSegment

Rectangle(PdfPoint, PdfSize)

Creates a rectangle segment.

Declaration
public static PathSegment Rectangle(PdfPoint bottomLeft, PdfSize size)
Parameters
Type Name Description
PdfPoint bottomLeft
PdfSize size
Returns
Type Description
PathSegment

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
ValueType.ToString()

Transform(PdfMatrix)

Transform this segment by the given matrix.

Declaration
public PathSegment Transform(PdfMatrix matrix)
Parameters
Type Name Description
PdfMatrix matrix
Returns
Type Description
PathSegment

Operators

operator ==(PathSegment, PathSegment)

Equality operator.

Declaration
public static bool operator ==(PathSegment a, PathSegment b)
Parameters
Type Name Description
PathSegment a
PathSegment b
Returns
Type Description
bool

operator !=(PathSegment, PathSegment)

Inequality operator.

Declaration
public static bool operator !=(PathSegment a, PathSegment b)
Parameters
Type Name Description
PathSegment a
PathSegment b
Returns
Type Description
bool

Implements

IEquatable<T>
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX