Rect Methods

The Rect type exposes the following members.

Methods
  Name Description
Public method CompareTo
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object
Public methodStatic member Contains(Rect, Point)
Works out if a rect contains a point. A point at the top or left of the rectangle is counted as contained but one at the bottom or right is not. Thus an empty rectangle never contains any points.
Public methodStatic member Contains(Rect, Rect)
Works out if one rect (a) completely contains another (b). Identical rectangles are counted as contained.
Public methodStatic member Contains(Rect, Point, Double)
Works out if a rect contains a point. A point at the top or left of the rectangle is counted as contained but one at the bottom or right is not. Thus an empty rectangle never contains any points.
Public method Equals(Object)
Compare for equality.
(Overrides ValueTypeEquals(Object).)
Public method Equals(Rect, Double)
Compare for equality.
Public method GetHashCode
Obtain a hash code for the Rect.
(Overrides ValueTypeGetHashCode.)
Public methodStatic member Intersect
Find the intersection of two rectangles.
Public methodStatic member IntersectsWith
Determines if one rectangle intersects with another.
Public method Round
Round the dimensions of the rect to the nearest integer.
Public method ToString
Convert the Rect to a human readable string such as \'X=10; Y=20; W=100; H=200\'.
(Overrides ValueTypeToString.)
Public method ToString(IFormatProvider)
Convert the Rect to a human readable string such as \'X=10; Y=20; W=100; H=200\'.
Public methodStatic member Union
Determine the union of two supplied rectangles. The union is the smallest rectangle that contains both rectangles.
Top
See Also