Android.Graphics.Rect: Method Members

The methods of Android.Graphics.Rect are listed below. For a list of all members, see the Rect Members list.

See Also: Inherited members from Java.Lang.Object

Public Methods

CenterX() : int
CenterY() : int
Contains(Rect) : bool
Returns true iff the specified rectangle r is inside or equal to this rectangle.
Contains(int, int) : bool
Returns true if (x,y) is inside the rectangle.
Contains(int, int, int, int) : bool
Returns true iff the 4 specified sides of a rectangle are inside or equal to this rectangle. i.e. is this rectangle a superset of the specified rectangle.
DescribeContents() : int
Parcelable interface methods
ExactCenterX() : float
ExactCenterY() : float
FlattenToString() : string
Return a string representation of the rectangle in a well-defined format.
Height() : int
Inset(int, int)
Inset the rectangle by (dx,dy).
Intersect(Rect) : bool
If the specified rectangle intersects this rectangle, return true and set this rectangle to that intersection, otherwise return false and do not change this rectangle.
Intersect(int, int, int, int) : bool
If the rectangle specified by left,top,right,bottom intersects this rectangle, return true and set this rectangle to that intersection, otherwise return false and do not change this rectangle.
static
Intersects(Rect, Rect) : bool
Returns true iff the two specified rectangles intersect.
Intersects(int, int, int, int) : bool
Returns true if this rectangle intersects the specified rectangle.
Offset(int, int)
Offset the rectangle by adding dx to its left and right coordinates, and adding dy to its top and bottom coordinates.
OffsetTo(int, int)
Offset the rectangle to a specific (left, top) position, keeping its width and height the same.
ReadFromParcel(Android.OS.Parcel)
Set the rectangle's coordinates from the data stored in the specified parcel.
Set(Rect)
Copy the coordinates from src into this rectangle.
Set(int, int, int, int)
Set the rectangle's coordinates to the specified values.
SetEmpty()
Set the rectangle to (0,0,0,0)
SetIntersect(Rect, Rect) : bool
If rectangles a and b intersect, return true and set this rectangle to that intersection, otherwise return false and do not change this rectangle.
Sort()
Swap top/bottom or left/right if there are flipped (i.e. left > right and/or top > bottom).
ToShortString() : string
Return a string representation of the rectangle in a compact form.
static
UnflattenFromString(string) : Rect
Returns a Rect from a string of the form returned by Rect.FlattenToString, or null if the string is not of that form.
Union(Rect)
Update this Rect to enclose itself and the specified rectangle.
Union(int, int)
Update this Rect to enclose itself and the [x,y] coordinate.
Union(int, int, int, int)
Update this Rect to enclose itself and the specified rectangle.
Width() : int
WriteToParcel(Android.OS.Parcel, Android.OS.ParcelableWriteFlags)
Write this rectangle to the specified parcel.