共用方式為


Rect Constructors

Definition

Overloads

Rect()

Create a new empty Rect.

Rect(Rect)

Create a new rectangle, initialized with the values in the specified rectangle (which is left unmodified).

Rect(Int32, Int32, Int32, Int32)

Create a new rectangle with the specified coordinates.

Rect()

Create a new empty Rect.

[Android.Runtime.Register(".ctor", "()V", "")]
public Rect ();
Attributes

Remarks

Create a new empty Rect. All coordinates are initialized to 0.

Java documentation for android.graphics.Rect.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

Rect(Rect)

Create a new rectangle, initialized with the values in the specified rectangle (which is left unmodified).

[Android.Runtime.Register(".ctor", "(Landroid/graphics/Rect;)V", "")]
public Rect (Android.Graphics.Rect? r);
[<Android.Runtime.Register(".ctor", "(Landroid/graphics/Rect;)V", "")>]
new Android.Graphics.Rect : Android.Graphics.Rect -> Android.Graphics.Rect

Parameters

r
Rect

The rectangle whose coordinates are copied into the new rectangle.

Attributes

Remarks

Create a new rectangle, initialized with the values in the specified rectangle (which is left unmodified).

Java documentation for android.graphics.Rect.Rect(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

Rect(Int32, Int32, Int32, Int32)

Create a new rectangle with the specified coordinates.

[Android.Runtime.Register(".ctor", "(IIII)V", "")]
public Rect (int left, int top, int right, int bottom);
[<Android.Runtime.Register(".ctor", "(IIII)V", "")>]
new Android.Graphics.Rect : int * int * int * int -> Android.Graphics.Rect

Parameters

left
Int32

The X coordinate of the left side of the rectangle

top
Int32

The Y coordinate of the top of the rectangle

right
Int32

The X coordinate of the right side of the rectangle

bottom
Int32

The Y coordinate of the bottom of the rectangle

Attributes

Remarks

Create a new rectangle with the specified coordinates. Note: no range checking is performed, so the caller must ensure that left <= right and top <= bottom.

Java documentation for android.graphics.Rect.Rect(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