Class PdfRectangle
Represents a PDF rectangle value, that is internally an array with 4 real values.
public sealed class PdfRectangle : PdfItem, ICloneable
- Inheritance
-
PdfRectangle
- Implements
- Inherited Members
Constructors
PdfRectangle()
Initializes a new instance of the PdfRectangle class.
public PdfRectangle()
PdfRectangle(XPoint, XPoint)
Initializes a new instance of the PdfRectangle class with two points specifying two diagonally opposite corners.
public PdfRectangle(XPoint pt1, XPoint pt2)
Parameters
PdfRectangle(XPoint, XSize)
Initializes a new instance of the PdfRectangle class with the specified location and size.
public PdfRectangle(XPoint pt, XSize size)
Parameters
PdfRectangle(XRect)
Initializes a new instance of the PdfRectangle class with the specified XRect.
public PdfRectangle(XRect rect)
Parameters
rect
XRect
Fields
Empty
Represents an empty PdfRectangle.
public static readonly PdfRectangle Empty
Field Value
Properties
Height
Gets Y2 - Y1.
public double Height { get; }
Property Value
IsEmpty
Tests whether all coordinates are zero.
public bool IsEmpty { get; }
Property Value
Location
Gets or sets the coordinates of the first point of this PdfRectangle.
public XPoint Location { get; }
Property Value
Size
Gets or sets the size of this PdfRectangle.
public XSize Size { get; }
Property Value
Width
Gets X2 - X1.
public double Width { get; }
Property Value
X1
Gets or sets the x-coordinate of the first corner of this PdfRectangle.
public double X1 { get; }
Property Value
X2
Gets or sets the x-coordinate of the second corner of this PdfRectangle.
public double X2 { get; }
Property Value
Y1
Gets or sets the y-coordinate of the first corner of this PdfRectangle.
public double Y1 { get; }
Property Value
Y2
Gets or sets the y-coordinate of the second corner of this PdfRectangle.
public double Y2 { get; }
Property Value
Methods
Clone()
Clones this instance.
public PdfRectangle Clone()
Returns
Contains(XPoint)
Determines if the specified point is contained within this PdfRectangle.
public bool Contains(XPoint pt)
Parameters
pt
XPoint
Returns
Contains(XRect)
Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle.
public bool Contains(XRect rect)
Parameters
rect
XRect
Returns
Contains(PdfRectangle)
Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle.
public bool Contains(PdfRectangle rect)
Parameters
rect
PdfRectangle
Returns
Contains(double, double)
Determines if the specified point is contained within this PdfRectangle.
public bool Contains(double x, double y)
Parameters
Returns
Copy()
Implements cloning this instance.
protected override object Copy()
Returns
Equals(object?)
Tests whether the specified object is a PdfRectangle and has equal coordinates.
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
Serves as a hash function for a particular type.
public override int GetHashCode()
Returns
ToString()
Returns the rectangle as a string in the form «[x1 y1 x2 y2]».
public override string ToString()
Returns
ToXRect()
Returns the rectangle as an XRect object.
public XRect ToXRect()
Returns
Operators
operator ==(PdfRectangle?, PdfRectangle?)
Tests whether two structures have equal coordinates.
public static bool operator ==(PdfRectangle? left, PdfRectangle? right)
Parameters
left
PdfRectangleright
PdfRectangle
Returns
operator !=(PdfRectangle?, PdfRectangle?)
Tests whether two structures differ in one or more coordinates.
public static bool operator !=(PdfRectangle? left, PdfRectangle? right)
Parameters
left
PdfRectangleright
PdfRectangle