Struct Quadrilateral
A quadrilateral defined by four points in user-space coordinates (spec §8.4.4). Used by text-markup annotations (/QuadPoints) and text search/highlight results. Points are ordered: P1 (bottom-left), P2 (bottom-right), P3 (top-right), P4 (top-left).
Implements
Inherited Members
Namespace: DRIT.Pdf.Content
Assembly: DRIT.Pdf.dll
Syntax
public readonly struct Quadrilateral : IEquatable<Quadrilateral>
Constructors
Quadrilateral(PdfPoint, PdfPoint, PdfPoint, PdfPoint)
Initializes a quadrilateral from four points.
Declaration
public Quadrilateral(PdfPoint p1, PdfPoint p2, PdfPoint p3, PdfPoint p4)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfPoint | p1 | |
| PdfPoint | p2 | |
| PdfPoint | p3 | |
| PdfPoint | p4 |
Quadrilateral(PdfRect)
Initializes a quadrilateral from a rectangle.
Declaration
public Quadrilateral(PdfRect rect)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfRect | rect |
Properties
Bounds
Gets the bounding rectangle of this quadrilateral.
Declaration
public PdfRect Bounds { get; }
Property Value
| Type | Description |
|---|---|
| PdfRect |
P1
Gets the first point (bottom-left).
Declaration
public PdfPoint P1 { get; }
Property Value
| Type | Description |
|---|---|
| PdfPoint |
P2
Gets the second point (bottom-right).
Declaration
public PdfPoint P2 { get; }
Property Value
| Type | Description |
|---|---|
| PdfPoint |
P3
Gets the third point (top-right).
Declaration
public PdfPoint P3 { get; }
Property Value
| Type | Description |
|---|---|
| PdfPoint |
P4
Gets the fourth point (top-left).
Declaration
public PdfPoint P4 { get; }
Property Value
| Type | Description |
|---|---|
| PdfPoint |
Methods
Equals(Quadrilateral)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Quadrilateral other)
Parameters
| Type | Name | Description |
|---|---|---|
| Quadrilateral | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
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 |
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
ToPoints()
Gets the four points as an array in QuadPoints order.
Declaration
public PdfPoint[] ToPoints()
Returns
| Type | Description |
|---|---|
| PdfPoint[] |
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 the quadrilateral by the given matrix.
Declaration
public Quadrilateral Transform(PdfMatrix matrix)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfMatrix | matrix |
Returns
| Type | Description |
|---|---|
| Quadrilateral |
Operators
operator ==(Quadrilateral, Quadrilateral)
Equality operator.
Declaration
public static bool operator ==(Quadrilateral a, Quadrilateral b)
Parameters
| Type | Name | Description |
|---|---|---|
| Quadrilateral | a | |
| Quadrilateral | b |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(Quadrilateral, Quadrilateral)
Inequality operator.
Declaration
public static bool operator !=(Quadrilateral a, Quadrilateral b)
Parameters
| Type | Name | Description |
|---|---|---|
| Quadrilateral | a | |
| Quadrilateral | b |
Returns
| Type | Description |
|---|---|
| bool |