PeachDrawing.Core

PeachDrawing.Core

Rect Struct

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

public struct Rect
Constructors  
Rect(double, double, double, double) Initializes a new instance of the Rect class with the specified location and size.
Rect(PaintPoint, Size) Initializes a new instance of the Rect class with the specified location and size.
Fields  
Empty Represents an instance of the Rect class with its members uninitialized.
Properties  
Bottom Gets the y-coordinate that is the sum of Y and Height of this Rect structure.
Height Gets or sets the height of this Rect structure.
IsEmpty Tests whether the Width or Height property of this Rect has a value of zero.
Left Gets the x-coordinate of the left edge of this Rect structure.
Location Gets or sets the coordinates of the upper-left corner of this Rect structure.
Right Gets the x-coordinate that is the sum of X and Width of this Rect structure.
Size Gets or sets the size of this Rect.
Top Gets the y-coordinate of the top edge of this Rect structure.
Width Gets or sets the width of this Rect structure.
X Gets or sets the x-coordinate of the upper-left corner of this Rect structure.
Y Gets or sets the y-coordinate of the upper-left corner of this Rect structure.
Methods  
Contains(double, double) Determines if the specified point is contained within this Rect structure.
Contains(PaintPoint) Determines if the specified point is contained within this Rect structure.
Contains(Rect) Determines if the rectangular region represented by rect is entirely contained within this Rect structure.
Equals(object) Tests whether obj is a Rect with the same location and size of this Rect.
FromLTRB(double, double, double, double) Creates a Rect structure with upper-left corner and lower-right corner at the specified locations.
GetHashCode() Gets the hash code for this Rect structure. For information about the use of hash codes, see Object.GetHashCode.
Inflate(double, double) Inflates this Rect structure by the specified amount.
Inflate(Rect, double, double) Creates and returns an inflated copy of the specified Rect structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.
Inflate(Size) Inflates this Rect by the specified amount.
Intersect(Rect) Replaces this Rect structure with the intersection of itself and the specified Rect structure.
Intersect(Rect, Rect) Returns a Rect structure that represents the intersection of two rectangles. If there is no intersection, and empty Rect is returned.
IntersectsWith(Rect) Determines if this rectangle intersects with rect.
Offset(double, double) Adjusts the location of this rectangle by the specified amount.
Offset(PaintPoint) Adjusts the location of this rectangle by the specified amount.
ToString() Converts the Location and Size of this Rect to a human-readable string.
Union(Rect, Rect) Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.
Operators  
operator ==(Rect, Rect) Tests whether two Rect structures have equal location and size.
operator !=(Rect, Rect) Tests whether two Rect structures differ in location or size.