Rect 생성자

정의

구조체의 새 인스턴스를 초기화합니다 Rect .

오버로드

Name Description
Rect(Size)

지정된 크기이며 (0,0)에 있는 구조체의 새 인스턴스 Rect 를 초기화합니다.

Rect(Point, Point)

지정된 두 점을 포함할 수 있을 만큼 충분히 큰 구조체의 Rect 새 인스턴스를 초기화합니다.

Rect(Point, Size)

지정된 왼쪽 위 모서리 위치와 지정된 너비 및 높이가 있는 구조체의 새 인스턴스 Rect 를 초기화합니다.

Rect(Point, Vector)

지정된 점과 지정된 점 및 지정된 벡터의 Rect 합계를 포함할 만큼 충분히 큰 구조체의 새 인스턴스를 초기화합니다.

Rect(Double, Double, Double, Double)

지정된 x좌표, y좌표, 너비 및 높이가 있는 구조체의 Rect 새 인스턴스를 초기화합니다.

Rect(Size)

지정된 크기이며 (0,0)에 있는 구조체의 새 인스턴스 Rect 를 초기화합니다.

public:
 Rect(System::Windows::Size size);
public Rect(System.Windows.Size size);
new System.Windows.Rect : System.Windows.Size -> System.Windows.Rect
Public Sub New (size As Size)

매개 변수

size
Size

Size 사각형의 너비와 높이를 지정하는 구조체입니다.

예제

다음 예제에서는 생성자를 사용하여 RectRect(Size) 구조를 만드는 방법을 보여 있습니다.

private Rect createRectExample2()
{
    // This constructor initializes a new instance of the Rect structure that 
    // is of the specified size and is located at (0,0). 
    Rect myRectangle = new Rect(new Size(200, 50));

    // Returns a rectangle with a width of 200, a height of 50 and a position
    // of 0,0.
    return myRectangle;
}

적용 대상

Rect(Point, Point)

지정된 두 점을 포함할 수 있을 만큼 충분히 큰 구조체의 Rect 새 인스턴스를 초기화합니다.

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

매개 변수

point1
Point

새 사각형에 포함해야 하는 첫 번째 지점입니다.

point2
Point

새 사각형에 포함되어야 하는 두 번째 지점입니다.

예제

다음 예제에서는 생성자를 사용하여 RectRect(Point, Point) 구조를 만드는 방법을 보여 있습니다.

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;
}

적용 대상

Rect(Point, Size)

지정된 왼쪽 위 모서리 위치와 지정된 너비 및 높이가 있는 구조체의 새 인스턴스 Rect 를 초기화합니다.

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

매개 변수

location
Point

사각형의 왼쪽 위 모퉁이 위치를 지정하는 점입니다.

size
Size

Size 사각형의 너비와 높이를 지정하는 구조체입니다.

예제

다음 예제에서는 생성자를 사용하여 RectRect(Point, Size) 구조를 만드는 방법을 보여 있습니다.

private Rect createRectExample4()
{
    // This constructor initializes a new instance of the Rect structure that has the 
    // specified top-left corner location and the specified width and height (Size).    
    Rect myRectangle = new Rect(new Point(15, 30), new Size(35, 40));

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

적용 대상

Rect(Point, Vector)

지정된 점과 지정된 점 및 지정된 벡터의 Rect 합계를 포함할 만큼 충분히 큰 구조체의 새 인스턴스를 초기화합니다.

public:
 Rect(System::Windows::Point point, System::Windows::Vector vector);
public Rect(System.Windows.Point point, System.Windows.Vector vector);
new System.Windows.Rect : System.Windows.Point * System.Windows.Vector -> System.Windows.Rect
Public Sub New (point As Point, vector As Vector)

매개 변수

point
Point

사각형에 포함해야 하는 첫 번째 지점입니다.

vector
Vector

지정된 지점을 오프셋할 양입니다. 결과 사각형은 두 점을 모두 포함할 수 있을 만큼 충분히 큽니다.

예제

다음 예제에서는 생성자를 사용하여 RectRect(Point, Vector) 구조를 만드는 방법을 보여 있습니다.

private Rect createRectExample5()
{
    // This constructor Intializes a new instance of the Rect structure that is exactly 
    // large enough to contain the specified point and the sum of the specified point 
    // and the specified vector.   
    Rect myRectangle = new Rect(new Point(15, 30), new Vector(35, 40));

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

적용 대상

Rect(Double, Double, Double, Double)

지정된 x좌표, y좌표, 너비 및 높이가 있는 구조체의 Rect 새 인스턴스를 초기화합니다.

public:
 Rect(double x, double y, double width, double height);
public Rect(double x, double y, double width, double height);
new System.Windows.Rect : double * double * double * double -> System.Windows.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

사각형의 높이입니다.

예외

width 는 음수 값입니다.

-또는-

height 는 음수 값입니다.

설명

다음 예제에서는 생성자를 사용하여 RectRect(Double, Double, Double, Double) 구조를 만드는 방법을 보여 있습니다.

private Rect createRectExample6()
{
    // This constructor intializes a new instance of the Rect structure with the specified 
    // x- and y-coordinates and the specified width and height. 
    Rect myRectangle = new Rect(15, 30, 35, 40);

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

적용 대상