Rect 构造函数

定义

重载

Rect(Point, Point)

初始化 Rect 结构,此结构的大小刚好足以包含两个指定点。

Rect(Point, Size)

基于原点和大小初始化 Rect 结构。

Rect(Double, Double, Double, Double)

初始化 Rect 结构,此结构具有指定的 x 坐标、y 坐标、宽度和高度。

注解

此结构表示 Windows 运行时 (WinRT) 结构的 .NET 投影 Rect 。 有关详细信息,请参阅 UWP API 参考中的 Rect

Rect(Point, Point)

初始化 Rect 结构,此结构的大小刚好足以包含两个指定点。

public:
 Rect(Windows::Foundation::Point point1, Windows::Foundation::Point point2);
public Rect (Windows.Foundation.Point point1, Windows.Foundation.Point point2);
new Windows.Foundation.Rect : Windows.Foundation.Point * Windows.Foundation.Point -> Windows.Foundation.Rect
Public Sub New (point1 As Point, point2 As Point)

参数

point1
Point

新矩形必须包含的第一个点。

point2
Point

新矩形必须包含的第二个点。

适用于

Rect(Point, Size)

基于原点和大小初始化 Rect 结构。

public:
 Rect(Windows::Foundation::Point location, Windows::Foundation::Size size);
public Rect (Windows.Foundation.Point location, Windows.Foundation.Size size);
new Windows.Foundation.Rect : Windows.Foundation.Point * Windows.Foundation.Size -> Windows.Foundation.Rect
Public Sub New (location As Point, size As Size)

参数

location
Point

Rect 的原点。

size
Size

Rect 的大小。

适用于

Rect(Double, Double, Double, Double)

初始化 Rect 结构,此结构具有指定的 x 坐标、y 坐标、宽度和高度。

public:
 Rect(double x, double y, double width, double height);
public Rect (double x, double y, double width, double height);
new Windows.Foundation.Rect : double * double * double * double -> Windows.Foundation.Rect
Public Sub New (x As Double, y As Double, width As Double, height As Double)

参数

x
Double

矩形左上角的 x 坐标。

y
Double

矩形左上角的 y 坐标。

width
Double

矩形的宽度。

height
Double

矩形的高度。

例外

宽度或高度小于 0。

适用于