Rect.Contains Method

Definition

Overloads

Contains(Rect)

Returns true iff the specified rectangle r is inside or equal to this rectangle.

Contains(Int32, Int32)

Returns true if (x,y) is inside the rectangle.

Contains(Int32, Int32, Int32, Int32)

Returns true iff the 4 specified sides of a rectangle are inside or equal to this rectangle.

Contains(Rect)

Returns true iff the specified rectangle r is inside or equal to this rectangle.

[Android.Runtime.Register("contains", "(Landroid/graphics/Rect;)Z", "")]
public bool Contains (Android.Graphics.Rect r);
[<Android.Runtime.Register("contains", "(Landroid/graphics/Rect;)Z", "")>]
member this.Contains : Android.Graphics.Rect -> bool

Parameters

r
Rect

The rectangle being tested for containment.

Returns

true iff the specified rectangle r is inside or equal to this rectangle

Attributes

Remarks

Returns true iff the specified rectangle r is inside or equal to this rectangle. An empty rectangle never contains another rectangle.

Java documentation for android.graphics.Rect.contains(android.graphics.Rect).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Contains(Int32, Int32)

Returns true if (x,y) is inside the rectangle.

[Android.Runtime.Register("contains", "(II)Z", "")]
public bool Contains (int x, int y);
[<Android.Runtime.Register("contains", "(II)Z", "")>]
member this.Contains : int * int -> bool

Parameters

x
Int32

The X coordinate of the point being tested for containment

y
Int32

The Y coordinate of the point being tested for containment

Returns

true iff (x,y) are contained by the rectangle, where containment means left <= x < right and top <= y < bottom

Attributes

Remarks

Returns true if (x,y) is inside the rectangle. The left and top are considered to be inside, while the right and bottom are not. This means that for a x,y to be contained: left <= x < right and top <= y < bottom. An empty rectangle never contains any point.

Java documentation for android.graphics.Rect.contains(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Contains(Int32, Int32, Int32, Int32)

Returns true iff the 4 specified sides of a rectangle are inside or equal to this rectangle.

[Android.Runtime.Register("contains", "(IIII)Z", "")]
public bool Contains (int left, int top, int right, int bottom);
[<Android.Runtime.Register("contains", "(IIII)Z", "")>]
member this.Contains : int * int * int * int -> bool

Parameters

left
Int32

The left side of the rectangle being tested for containment

top
Int32

The top of the rectangle being tested for containment

right
Int32

The right side of the rectangle being tested for containment

bottom
Int32

The bottom of the rectangle being tested for containment

Returns

true iff the the 4 specified sides of a rectangle are inside or equal to this rectangle

Attributes

Remarks

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. An empty rectangle never contains another rectangle.

Java documentation for android.graphics.Rect.contains(int, int, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to