Rect.Inflate 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
사각형을 지정된 크기만큼 확장하거나 축소하여 발생하는 사각형을 만듭니다.
오버로드
| Name | Description |
|---|---|
| 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 사각형 Left 과 속성을 늘릴 크기를 지정합니다Right. 구조체의 Size 속성은 Height 사각형 Top 과 속성을 늘릴 크기를 지정합니다Bottom.
예외
이 메서드는 사각형에서 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
매개 변수
- size
- Size
사각형을 확장할 크기를 지정합니다. 구조체의 Size 속성은 Width 사각형 Left 과 속성을 늘릴 크기를 지정합니다Right. 구조체의 Size 속성은 Height 사각형 Top 과 속성을 늘릴 크기를 지정합니다Bottom.
반품
결과 사각형입니다.
예외
rect 는 사각형입니다 Empty .
예제
다음 예제에서는 사각형의 크기를 변경 하는 메서드를 사용 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
매개 변수
- width
- Double
사각형의 왼쪽과 오른쪽을 확장하거나 축소할 크기입니다.
- height
- Double
사각형의 위쪽과 아래쪽 측면을 확장하거나 축소할 크기입니다.
반품
결과 사각형입니다.
예외
rect 는 사각형입니다 Empty .
예제
다음 예제에서는 사각형의 크기를 변경 하는 메서드를 사용 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.