Table of Contents

Struct XRect

Namespace
PdfSharp.Drawing
Assembly
PdfSharp.dll

Stores a set of four floating-point numbers that represent the location and size of a rectangle.

[Serializable]
public struct XRect

Constructors

XRect(XPoint, XPoint)

Initializes a new instance of the XRect class.

XRect(XPoint, XSize)

Initializes a new instance of the XRect class.

XRect(XPoint, XVector)

Initializes a new instance of the XRect class.

XRect(XSize)

Initializes a new instance of the XRect class.

XRect(double, double, double, double)

Initializes a new instance of the XRect class.

Properties

Bottom

Gets the y-axis value of the bottom side of the rectangle.

BottomLeft

Gets the position of the bottom-left corner of the rectangle.

BottomRight

Gets the position of the bottom-right corner of the rectangle.

Center

Gets the center of the rectangle.

Empty

Gets the empty rectangle.

Height

Gets or sets the height of the rectangle.

IsEmpty

Gets a value indicating whether this instance is empty.

Left

Gets the x-axis value of the left side of the rectangle.

Location

Gets or sets the location of the rectangle.

Right

Gets the x-axis value of the right side of the rectangle.

Size

Gets or sets the size of the rectangle.

Top

Gets the y-axis value of the top side of the rectangle.

TopLeft

Gets the position of the top-left corner of the rectangle.

TopRight

Gets the position of the top-right corner of the rectangle.

Width

Gets or sets the width of the rectangle.

X

Gets or sets the X value of the rectangle.

Y

Gets or sets the Y value of the rectangle.

Methods

Contains(XPoint)

Indicates whether the rectangle contains the specified point.

Contains(XRect)

Indicates whether the rectangle contains the specified rectangle.

Contains(double, double)

Indicates whether the rectangle contains the specified point.

Equals(XRect)

Determines whether this instance and the specified rect are equal.

Equals(XRect, XRect)

Determines whether the two rectangles are equal.

Equals(object?)

Determines whether this instance and the specified object are equal.

FromLTRB(double, double, double, double)

Creates a rectangle from four straight lines.

GetHashCode()

Returns the hash code for this instance.

Inflate(XRect, XSize)

Returns the rectangle that results from expanding the specified rectangle by the specified Size, in all directions.

Inflate(XRect, double, double)

Creates a rectangle that results from expanding or shrinking the specified rectangle by the specified width and height amounts, in all directions.

Inflate(XSize)

Expands the rectangle by using the specified Size, in all directions.

Inflate(double, double)

Expands or shrinks the rectangle by using the specified width and height amounts, in all directions.

Intersect(XRect)

Sets current rectangle to the intersection of the current rectangle and the specified rectangle.

Intersect(XRect, XRect)

Returns the intersection of two rectangles.

IntersectsWith(XRect)

Indicates whether the specified rectangle intersects with the current rectangle.

Offset(XRect, XVector)

Returns a rectangle that is offset from the specified rectangle by using the specified vector.

Offset(XRect, double, double)

Returns a rectangle that is offset from the specified rectangle by using specified horizontal and vertical amounts.

Offset(XVector)

Moves a rectangle by the specified amount.

Offset(double, double)

Moves a rectangle by the specified amount.

Parse(string)

Parses the rectangle from a string.

Scale(double, double)

Multiplies the size of the current rectangle by the specified x and y values.

ToString()

Converts this XRect to a human-readable string.

ToString(IFormatProvider)

Converts this XRect to a human-readable string.

Transform(XMatrix)

Transforms the rectangle by applying the specified matrix.

Transform(XRect, XMatrix)

Returns the rectangle that results from applying the specified matrix to the specified rectangle.

Union(XPoint)

Sets current rectangle to the union of the current rectangle and the specified point.

Union(XRect)

Sets current rectangle to the union of the current rectangle and the specified rectangle.

Union(XRect, XPoint)

Returns the union of a rectangle and a point.

Union(XRect, XRect)

Returns the union of two rectangles.

Operators

operator +(XRect, XPoint)

Translates the rectangle by adding the specified point.

operator ==(XRect, XRect)

Determines whether the two rectangles are equal.

operator !=(XRect, XRect)

Determines whether the two rectangles are not equal.

operator -(XRect, XPoint)

Translates the rectangle by subtracting the specified point.