Rect Constructors

Definition

Overloads

Rect(Point, Point)

Initializes a Rect struct that is exactly large enough to contain the two specified points.

Rect(Point, Size)

Initializes a Rect struct based on an origin and size.

Rect(Double, Double, Double, Double)

Initializes a Rect struct that has the specified x-coordinate, y-coordinate, width, and height.

Remarks

This struct represents the .NET projection of the Windows Runtime (WinRT) Rect struct. For more information, see Rect in the UWP API reference.

Rect(Point, Point)

Initializes a Rect struct that is exactly large enough to contain the two specified points.

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)

Parameters

point1
Point

The first point that the new rectangle must contain.

point2
Point

The second point that the new rectangle must contain.

Applies to

Rect(Point, Size)

Initializes a Rect struct based on an origin and size.

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)

Parameters

location
Point

The origin of the new Rect.

size
Size

The size of the new Rect.

Applies to

Rect(Double, Double, Double, Double)

Initializes a Rect struct that has the specified x-coordinate, y-coordinate, width, and height.

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)

Parameters

x
Double

The x-coordinate of the top-left corner of the rectangle.

y
Double

The y-coordinate of the top-left corner of the rectangle.

width
Double

The width of the rectangle.

height
Double

The height of the rectangle.

Exceptions

width or height are less than 0.

Applies to