Namespace: PdfSharp.Pdf
Represents a PDF rectangle value, that is internally an array with 4 real values.
public sealed class PdfRectangle : PdfItem, System.ICloneable
Inheritance Object → PdfItem → PdfRectangle
Implements ICloneable
Represents an empty PdfRectangle.
public static PdfRectangle Empty;
Tests whether all coordinates are zero.
public bool IsEmpty { get; }
Gets or sets the x-coordinate of the first corner of this PdfRectangle.
public double X1 { get; }
Gets or sets the y-coordinate of the first corner of this PdfRectangle.
public double Y1 { get; }
Gets or sets the x-coordinate of the second corner of this PdfRectangle.
public double X2 { get; }
Gets or sets the y-coordinate of the second corner of this PdfRectangle.
public double Y2 { get; }
Gets X2 - X1.
public double Width { get; }
Gets Y2 - Y1.
public double Height { get; }
Gets or sets the coordinates of the first point of this PdfRectangle.
public XPoint Location { get; }
Gets or sets the size of this PdfRectangle.
public XSize Size { get; }
Initializes a new instance of the PdfRectangle class.
public PdfRectangle()
Initializes a new instance of the PdfRectangle class with two points specifying two diagonally opposite corners.
public PdfRectangle(XPoint pt1, XPoint pt2)
pt1
XPoint
pt2
XPoint
Initializes a new instance of the PdfRectangle class with the specified location and size.
public PdfRectangle(XPoint pt, XSize size)
pt
XPoint
size
XSize
Initializes a new instance of the PdfRectangle class with the specified XRect.
public PdfRectangle(XRect rect)
rect
XRect
Clones this instance.
public PdfRectangle Clone()
Implements cloning this instance.
protected object Copy()
Tests whether the specified object is a PdfRectangle and has equal coordinates.
public bool Equals(object obj)
obj
Object
Serves as a hash function for a particular type.
public int GetHashCode()
Determines if the specified point is contained within this PdfRectangle.
public bool Contains(XPoint pt)
pt
XPoint
Determines if the specified point is contained within this PdfRectangle.
public bool Contains(double x, double y)
x
Double
y
Double
Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle.
public bool Contains(XRect rect)
rect
XRect
Determines if the rectangular region represented by rect is entirely contained within this PdfRectangle.
public bool Contains(PdfRectangle rect)
rect
PdfRectangle
Returns the rectangle as an XRect object.
public XRect ToXRect()
Returns the rectangle as a string in the form «[x1 y1 x2 y2]».
public string ToString()
Writes the rectangle.
internal void WriteObject(PdfWriter writer)
writer
PdfWriter