Export (0) Print
Expand All

Rect.Rect(Point, Point) Constructor

Intializes a new instance of the Rect structure that is exactly large enough to contain the two specified points.

Namespace: System.Windows
Assembly: WindowsBase (in windowsbase.dll)

public Rect (
	Point point1,
	Point point2
)
public Rect (
	Point point1, 
	Point point2
)
public function Rect (
	point1 : Point, 
	point2 : Point
)
You cannot use constructors in XAML.

Parameters

point1

The first point that the new rectangle must contain.

point2

The second point that the new rectangle must contain.

The following example shows how to create a Rect structure using the Rect constructor.

private Rect createRectExample3()
{
    // This constructor intializes a new instance of the Rect structure that is 
    // exactly large enough to contain the two specified points.  
    Rect myRectangle = new Rect(new Point(15, 30), new Point(50,70));

    // Returns a rectangle with a position of 15,30, a width of 35 and height of 40.
    return myRectangle;

}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft