Rect.Inflate 메서드

정의

사각형을 지정된 크기만큼 확장하거나 축소한 사각형을 만듭니다.

오버로드

Inflate(Size)

지정된 Size를 사용하여 모든 방향으로 사각형을 확장합니다.

Inflate(Double, Double)

사각형을 지정된 너비 및 높이만큼 모든 방향으로 확장하거나 축소합니다.

Inflate(Rect, Size)

지정된 사각형을 지정된 Size만큼 모든 방향으로 확장하여 만들어지는 사각형을 반환합니다.

Inflate(Rect, Double, Double)

지정된 사각형을 지정된 너비 및 높이만큼 모든 방향으로 확장하거나 축소한 사각형을 만듭니다.

Inflate(Size)

지정된 Size를 사용하여 모든 방향으로 사각형을 확장합니다.

public:
 void Inflate(System::Windows::Size size);
public void Inflate (System.Windows.Size size);
member this.Inflate : System.Windows.Size -> unit
Public Sub Inflate (size As Size)

매개 변수

size
Size

사각형을 확장할 크기를 지정합니다. Size 구조체의 Width 속성은 사각형의 LeftRight 속성을 늘릴 크기를 지정합니다. Size 구조체의 Height 속성은 사각형의 TopBottom 속성을 늘릴 크기를 지정합니다.

예외

Empty 사각형에 대해 이 메서드를 호출한 경우

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다는 Inflate(Size) 메서드 사각형의 크기를 늘립니다.

private Size inflateExample1()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle.Size = new Size(200, 50);

    // Use the Inflate method to expand the rectangle by the specified Size in all
    // directions. The new size is 240,110. Note: Width of the resulting rectangle  
    // is increased by twice the Width of the specified Size structure because  
    // both the left and right sides of the rectangle are inflated. Likewise, the 
    // Height of the resulting rectangle is increased by twice the Height of the 
    // specified Size structure.
    myRectangle.Inflate(new Size(20,30));

    return myRectangle.Size;
}

설명

Width 씩 증가 됩니다 결과 사각형의 두 번 합니다 Width 지정 된 Size 팽창 된 사각형의 왼쪽과 오른쪽에 모두 있으므로 구조체. 마찬가지로 합니다 Height 결과 사각형의 씩 증가 됩니다 두 번 합니다 Height 지정 된 Size 구조입니다.

추가 정보

적용 대상

Inflate(Double, Double)

사각형을 지정된 너비 및 높이만큼 모든 방향으로 확장하거나 축소합니다.

public:
 void Inflate(double width, double height);
public void Inflate (double width, double height);
member this.Inflate : double * double -> unit
Public Sub Inflate (width As Double, height As Double)

매개 변수

width
Double

사각형의 왼쪽 및 오른쪽을 확장하거나 축소할 크기입니다.

height
Double

사각형의 위쪽 및 아래쪽을 확장하거나 축소할 크기입니다.

예외

Empty 사각형에 대해 이 메서드를 호출한 경우

예제

다음 예제에서는 사용 하는 방법의 Inflate(Double, Double) 사각형의 크기를 변경 하는 방법입니다.

private Size inflateExample2()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle.Size = new Size(200,50);

    // Use the Inflate method to expand or shrink the rectangle by the specified 
    // width and height amounts. The new size is 160,150 (width shrunk by 40 and  
    // height increased by 100). Note: Width of the resulting rectangle is increased 
    // or shrunk by twice the specified width, because both the left and right sides  
    // of the rectangle are inflated or shrunk. Likewise, the height of the resulting 
    // rectangle is increased or shrunk by twice the specified height.
    myRectangle.Inflate(-20,50);

    return myRectangle.Size;
}

설명

Width 의 결과 사각형 증가 하거나 사각형의 왼쪽과 오른쪽에 모두 적용 되기 때문에 두 번 지정 된 너비 오프셋으로 감소 합니다. 마찬가지로,는 Height 의 결과 사각형 증가 하거나 감소 하 여 지정 된 높이 두 번입니다.

지정한 너비 또는 높이가 사각형을 현재 Width 보다 많이 축소하거나 Height 사각형에 음수 영역을 지정하면 사각형이 사각형이 됩니다 Empty .

추가 정보

적용 대상

Inflate(Rect, Size)

지정된 사각형을 지정된 Size만큼 모든 방향으로 확장하여 만들어지는 사각형을 반환합니다.

public:
 static System::Windows::Rect Inflate(System::Windows::Rect rect, System::Windows::Size size);
public static System.Windows.Rect Inflate (System.Windows.Rect rect, System.Windows.Size size);
static member Inflate : System.Windows.Rect * System.Windows.Size -> System.Windows.Rect
Public Shared Function Inflate (rect As Rect, size As Size) As Rect

매개 변수

rect
Rect

수정할 Rect 구조체입니다.

size
Size

사각형을 확장할 크기를 지정합니다. Size 구조체의 Width 속성은 사각형의 LeftRight 속성을 늘릴 크기를 지정합니다. Size 구조체의 Height 속성은 사각형의 TopBottom 속성을 늘릴 크기를 지정합니다.

반환

Rect

결과 사각형입니다.

예외

rectEmpty 사각형입니다.

예제

다음 예제에서는 사용 하는 방법의 Inflate(Rect, Size) 사각형의 크기를 변경 하는 방법입니다.

private Size inflateExample3()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle.Size = new Size(200, 50);

    // Use the static Inflate method to return an expanded version of myRectangle1.   
    // The size of myRectangle2 is 240,110. Note: Width of the resulting rectangle is increased 
    // by twice the Width of the specified Size structure, because both the left and right 
    // sides of the rectangle are inflated. Likewise, the Height of the resulting 
    // rectangle is increased by twice the Height of the specified Size structure.
    Rect myRectangle2 = Rect.Inflate(myRectangle, new Size(20, 30));

    return myRectangle2.Size;
}

설명

Width 씩 증가 됩니다 결과 사각형의 두 번 합니다 Width 지정 된 Size 팽창 된 사각형의 왼쪽과 오른쪽에 모두 있으므로 구조체. 마찬가지로 합니다 Height 결과 사각형의 씩 증가 됩니다 두 번 합니다 Height 지정 된 Size 구조입니다.

추가 정보

적용 대상

Inflate(Rect, Double, Double)

지정된 사각형을 지정된 너비 및 높이만큼 모든 방향으로 확장하거나 축소한 사각형을 만듭니다.

public:
 static System::Windows::Rect Inflate(System::Windows::Rect rect, double width, double height);
public static System.Windows.Rect Inflate (System.Windows.Rect rect, double width, double height);
static member Inflate : System.Windows.Rect * double * double -> System.Windows.Rect
Public Shared Function Inflate (rect As Rect, width As Double, height As Double) As Rect

매개 변수

rect
Rect

수정할 Rect 구조체입니다.

width
Double

사각형의 왼쪽 및 오른쪽을 확장하거나 축소할 크기입니다.

height
Double

사각형의 위쪽 및 아래쪽을 확장하거나 축소할 크기입니다.

반환

Rect

결과 사각형입니다.

예외

rectEmpty 사각형입니다.

예제

다음 예제에서는 사용 하는 방법의 Inflate(Rect, Double, Double) 사각형의 크기를 변경 하는 방법입니다.

private Size inflateExample4()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle.Size = new Size(200, 50);

    // Use the static Inflate method to return a version of myRectangle with a shrunk
    // width and expanded height. The size of myRectangle2 is 160,150. Note: Width of the resulting 
    // rectangle is increased or shrunk by twice the specified width, because both the
    // left and right sides of the rectangle are inflated or shrunk. Likewise, the height 
    // of the resulting rectangle is increased or shrunk by twice the specified height.
    Rect myRectangle2 = Rect.Inflate(myRectangle, -20, 50);

    return myRectangle2.Size;
}

설명

Width 의 결과 사각형 증가 하거나 사각형의 왼쪽과 오른쪽에 모두 적용 되기 때문에 두 번 지정 된 너비 오프셋으로 감소 합니다. 마찬가지로,는 Height 의 결과 사각형 증가 하거나 감소 하 여 지정 된 높이 두 번입니다.

지정한 너비 또는 높이 한정자가 사각형을 현재 Width 보다 많이 축소하거나 Height 사각형에 음수 영역을 지정하면 이 메서드가 반환됩니다 Rect.Empty.

추가 정보

적용 대상