PdfRectangle Struct
A rectangle in user space units (ISO 32000-2, 7.9.5): its lower-left and upper-right corners.
public readonly struct PdfRectangle : IEquatable<PdfRectangle>- Implements
Constructors
| Name | Description |
|---|---|
| PdfRectangle(double, double, double, double) | Initializes a new instance of the PdfRectangle struct. The corners are normalized: PdfRectangle.Left is the smaller x coordinate and PdfRectangle.Bottom the smaller y coordinate. |
PdfRectangle(double, double, double, double)
PdfRectangle.csInitializes a new instance of the PdfRectangle struct. The corners are normalized: PdfRectangle.Left is the smaller x coordinate and PdfRectangle.Bottom the smaller y coordinate.
Properties
| Name | Description |
|---|---|
| Bottom | Gets the smaller y coordinate. |
| Height | Gets the height. |
| Left | Gets the smaller x coordinate. |
| Right | Gets the greater x coordinate. |
| Top | Gets the greater y coordinate. |
| Width | Gets the width. |
Bottom
PdfRectangle.csHeight
PdfRectangle.csLeft
PdfRectangle.csRight
PdfRectangle.csWidth
PdfRectangle.csMethods
| Name | Description |
|---|---|
| Equals(PdfRectangle) | 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. |
| FromSize(double, double, double, double) | Creates a rectangle from its lower-left corner and its size. |
| GetHashCode() | Returns the hash code for this instance. |
| ToArray() | Converts the rectangle to an array of four numbers. |
| ToString() | Returns the fully qualified type name of this instance. |
| TryRead(PdfArray?, PdfRectangle) | Reads a rectangle from an array of four numbers. |
Equals overloads
Equals(PdfRectangle)
PdfRectangle.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(PdfRectangle other)Parameters
otherPdfRectangle- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
PdfRectangle.csFromSize(double, double, double, double)
PdfRectangle.csCreates a rectangle from its lower-left corner and its size.
public static PdfRectangle FromSize(double x, double y, double width, double height)Parameters
xdouble- The x coordinate of the lower-left corner.
ydouble- The y coordinate of the lower-left corner.
widthdouble- The width.
heightdouble- The height.
Returns
PdfRectangle The rectangle.
GetHashCode()
PdfRectangle.csToArray()
PdfRectangle.csToString()
PdfRectangle.csTryRead(PdfArray?, PdfRectangle)
PdfRectangle.csReads a rectangle from an array of four numbers.
public static bool TryRead(PdfArray? array, out PdfRectangle rectangle)Parameters
arrayPdfArray?- The array.
rectanglePdfRectangle- The rectangle.
Returns
bool true when the array has four numbers.
Operators
| Name | Description |
|---|---|
| operator ==(PdfRectangle, PdfRectangle) | Indicates whether two rectangles are equal. |
| operator !=(PdfRectangle, PdfRectangle) | Indicates whether two rectangles are different. |
operator ==(PdfRectangle, PdfRectangle)
PdfRectangle.csIndicates whether two rectangles are equal.
public static bool operator ==(PdfRectangle left, PdfRectangle right)Parameters
leftPdfRectangle- The first rectangle.
rightPdfRectangle- The second rectangle.
Returns
bool true when the rectangles are equal.
operator !=(PdfRectangle, PdfRectangle)
PdfRectangle.csIndicates whether two rectangles are different.
public static bool operator !=(PdfRectangle left, PdfRectangle right)Parameters
leftPdfRectangle- The first rectangle.
rightPdfRectangle- The second rectangle.
Returns
bool true when the rectangles are different.