Rect Struct
Definition
Stores the location and size of a rectangular region.
Implements
Syntax
[Serializable]
public struct Rect : IEquatable<Rect>
Constructors
Rect(Point, Size) | Initializes a new instance of the Rect class with the specified location and size. |
Rect(Double, Double, Double, Double) | Initializes a new instance of the Rect class with the specified location and size. |
Rect(Vector4) | Initializes a new instance of the Rect struct from the specified System.Numerics.Vector4. |
Fields
Empty | Initializes a new instance of the Rect class. |
Properties
Bottom | Gets the y-coordinate of the lower-right corner of the rectangular region defined by this Rect. |
BottomLeft | BottomLeft Property - This is a read-only alias for the Point which is at X, Y + Height If this is the empty rectangle, the value will be positive infinity, negative infinity. |
BottomRight | BottomRight Property - This is a read-only alias for the Point which is at X + Width, Y + Height If this is the empty rectangle, the value will be negative infinity, negative infinity. |
Center | Gets the center point of this Rect. |
Height | Gets or sets the height of the rectangular region defined by this Rect. |
IsEmpty | |
Left | Gets the x-coordinate of the upper-left corner of the rectangular region defined by this Rect. |
Location | Gets or sets the coordinates of the upper-left corner of the rectangular region represented by this Rect. |
Right | Gets the x-coordinate of the lower-right corner of the rectangular region defined by this Rect. |
Size | Gets or sets the size of this Rect. |
Top | Gets the y-coordinate of the upper-left corner of the rectangular region defined by this Rect. |
TopLeft | TopLeft Property - This is a read-only alias for the Point which is at X, Y If this is the empty rectangle, the value will be positive infinity, positive infinity. |
TopRight | TopRight Property - This is a read-only alias for the Point which is at X + Width, Y If this is the empty rectangle, the value will be negative infinity, positive infinity. |
Width | Gets or sets the width of the rectangular region defined by this Rect. |
X | Gets or sets the x-coordinate of the upper-left corner of the rectangular region defined by this Rect. |
Y | Gets or sets the y-coordinate of the upper-left corner of the rectangular region defined by this Rect. |
Methods
Contains(Point) | Determines if the specified point is contained within the rectangular region defined by this Rect . |
Contains(Rect) | Determines if the rectangular region represented by |
Contains(Double, Double) | Determines if the specified point is contained within the rectangular region defined by this Rect . |
Equals(Rect) | Indicates whether the current object is equal to another object of the same type. |
Equals(Object) | Tests whether |
FromCenter(Point, Size) | Creates a new Rect from a centerpoint and size. |
FromLTRB(Double, Double, Double, Double) | Creates a new Rect with the specified location and size. |
GetHashCode() | Gets the hash code for this Rect. |
Inflate(Rect, Double, Double) | Creates a Rect that is inflated by the specified amount. |
Inflate(Size) | Inflates this Rect by the specified amount. |
Inflate(Double, Double) | Inflates this Rect by the specified amount. |
InflatedBy(Double, Double) | Creates a Rect that is inflated by the specified amount. |
Intersect(Rect) | Creates a Rectangle that represents the intersection between this Rectangle and rect. |
Intersect(Rect, Rect) | Creates a rectangle that represents the intersection between a and b. If there is no intersection, an empty rectangle is returned. |
IntersectsWith(Rect) | Determines if this rectangle intersects with rect. |
Offset(Point) | Adjusts the location of this rectangle by the specified amount. |
Offset(Double, Double) | Adjusts the location of this rectangle by the specified amount. |
OffsetBy(Double, Double) | Creates a Rect that is offset by the specified amount. |
Parse(String) | Parse - returns an instance converted from the provided string using the culture "en-US" string with Rect data |
ToString() | Converts the Location and Size of this Rect to a human-readable string. |
Union(Rect, Rect) | Creates a rectangle that represents the union between a and b. |
WithLocation(Double, Double) | Creates a Rect with the specified location. |
WithSize(Double, Double) | Creates a Rect with the specified size. |
Operators
Equality(Rect, Rect) | Tests whether two Rect objects have equal location and size. |
Explicit(Vector4 to Rect) | Converts the specified System.Numerics.Vector2 to a Rect. |
Implicit(Int32Rect to Rect) | |
Inequality(Rect, Rect) | Tests whether two Rect objects differ in location or size. |