Namespace: PdfSharp.Drawing
Stores a set of four floating-point numbers that represent the location and size of a rectangle.
public struct XRect
Inheritance Object → ValueType → XRect
Implements IFormattable
Gets the empty rectangle.
public static XRect Empty { get; }
Gets a value indicating whether this instance is empty.
public bool IsEmpty { get; }
Gets or sets the location of the rectangle.
public XPoint Location { get; set; }
Gets or sets the size of the rectangle.
public XSize Size { get; set; }
Gets or sets the X value of the rectangle.
public double X { get; set; }
Gets or sets the Y value of the rectangle.
public double Y { get; set; }
Gets or sets the width of the rectangle.
public double Width { get; set; }
Gets or sets the height of the rectangle.
public double Height { get; set; }
Gets the x-axis value of the left side of the rectangle.
public double Left { get; }
Gets the y-axis value of the top side of the rectangle.
public double Top { get; }
Gets the x-axis value of the right side of the rectangle.
public double Right { get; }
Gets the y-axis value of the bottom side of the rectangle.
public double Bottom { get; }
Gets the position of the top-left corner of the rectangle.
public XPoint TopLeft { get; }
Gets the position of the top-right corner of the rectangle.
public XPoint TopRight { get; }
Gets the position of the bottom-left corner of the rectangle.
public XPoint BottomLeft { get; }
Gets the position of the bottom-right corner of the rectangle.
public XPoint BottomRight { get; }
Gets the center of the rectangle.
public XPoint Center { get; }
Initializes a new instance of the XRect class.
XRect(double x, double y, double width, double height)
x Double
y Double
width Double
height Double
Initializes a new instance of the XRect class.
XRect(XPoint point1, XPoint point2)
point1 XPoint
point2 XPoint
Initializes a new instance of the XRect class.
XRect(XPoint point, XVector vector)
point XPoint
vector XVector
Initializes a new instance of the XRect class.
XRect(XPoint location, XSize size)
location XPoint
size XSize
Initializes a new instance of the XRect class.
XRect(XSize size)
size XSize
Creates a rectangle from four straight lines.
XRect FromLTRB(double left, double top, double right, double bottom)
left Double
top Double
right Double
bottom Double
Determines whether the two rectangles are equal.
bool Equals(XRect rect1, XRect rect2)
rect1 XRect
rect2 XRect
Determines whether this instance and the specified object are equal.
bool Equals(object o)
o Object
Determines whether this instance and the specified rect are equal.
bool Equals(XRect value)
value XRect
Returns the hash code for this instance.
int GetHashCode()
Parses the rectangle from a string.
XRect Parse(string source)
source String
Converts this XRect to a human readable string.
string ToString()
Converts this XRect to a human readable string.
string ToString(IFormatProvider provider)
provider IFormatProvider
string ConvertToString(string format, IFormatProvider provider)
format String
provider IFormatProvider
Indicates whether the rectangle contains the specified point.
bool Contains(XPoint point)
point XPoint
Indicates whether the rectangle contains the specified point.
bool Contains(double x, double y)
x Double
y Double
Indicates whether the rectangle contains the specified rectangle.
bool Contains(XRect rect)
rect XRect
Indicates whether the specified rectangle intersects with the current rectangle.
bool IntersectsWith(XRect rect)
rect XRect
Sets current rectangle to the intersection of the current rectangle and the specified rectangle.
void Intersect(XRect rect)
rect XRect
Returns the intersection of two rectangles.
XRect Intersect(XRect rect1, XRect rect2)
rect1 XRect
rect2 XRect
Sets current rectangle to the union of the current rectangle and the specified rectangle.
void Union(XRect rect)
rect XRect
Returns the union of two rectangles.
XRect Union(XRect rect1, XRect rect2)
rect1 XRect
rect2 XRect
Sets current rectangle to the union of the current rectangle and the specified point.
void Union(XPoint point)
point XPoint
Returns the union of a rectangle and a point.
XRect Union(XRect rect, XPoint point)
rect XRect
point XPoint
Moves a rectangle by the specified amount.
void Offset(XVector offsetVector)
offsetVector XVector
Moves a rectangle by the specified amount.
void Offset(double offsetX, double offsetY)
offsetX Double
offsetY Double
Returns a rectangle that is offset from the specified rectangle by using the specified vector.
XRect Offset(XRect rect, XVector offsetVector)
rect XRect
offsetVector XVector
Returns a rectangle that is offset from the specified rectangle by using specified horizontal and vertical amounts.
XRect Offset(XRect rect, double offsetX, double offsetY)
rect XRect
offsetX Double
offsetY Double
Expands the rectangle by using the specified Size, in all directions.
void Inflate(XSize size)
size XSize
Expands or shrinks the rectangle by using the specified width and height amounts, in all directions.
void Inflate(double width, double height)
width Double
height Double
Returns the rectangle that results from expanding the specified rectangle by the specified Size, in all directions.
XRect Inflate(XRect rect, XSize size)
rect XRect
size XSize
Creates a rectangle that results from expanding or shrinking the specified rectangle by the specified width and height amounts, in all directions.
XRect Inflate(XRect rect, double width, double height)
rect XRect
width Double
height Double
Returns the rectangle that results from applying the specified matrix to the specified rectangle.
XRect Transform(XRect rect, XMatrix matrix)
rect XRect
matrix XMatrix
Transforms the rectangle by applying the specified matrix.
void Transform(XMatrix matrix)
matrix XMatrix
Multiplies the size of the current rectangle by the specified x and y values.
void Scale(double scaleX, double scaleY)
scaleX Double
scaleY Double