RectangleF.Inflate 메서드

정의

RectangleF을 지정된 크기만큼 확대합니다.

오버로드

Inflate(SizeF)

RectangleF을 지정된 크기만큼 확대합니다.

Inflate(Single, Single)

RectangleF 구조체를 지정된 크기만큼 확대합니다.

Inflate(RectangleF, Single, Single)

지정된 RectangleF 구조체의 확대된 복사본을 만들고 반환합니다. 복사본은 지정된 크기만큼 확대되며 원래의 사각형은 수정되지 않고 남습니다.

Inflate(SizeF)

Source:
RectangleF.cs
Source:
RectangleF.cs
Source:
RectangleF.cs

RectangleF을 지정된 크기만큼 확대합니다.

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

매개 변수

size
SizeF

이 사각형을 확장할 크기입니다.

예제

이 예제는 Windows Forms 사용하도록 설계되었으며 OnPaint 이벤트 개체인 e가 필요합니다PaintEventArgs. 코드는 을 RectangleF 만들고 검은색으로 화면에 그립니다. 그리기 목적으로 로 변환 Rectangle 해야 합니다. 그런 다음 코드는 를 RectangleF확대하고 다시 로 Rectangle변환하고 빨간색으로 화면에 그립니다. 원래(검은색) 사각형은 x축을 따라 양방향으로 100포인트 확장됩니다.

public:
   void RectangleFInflateExample( PaintEventArgs^ e )
   {
      // Create a RectangleF structure.
      RectangleF myRectF = RectangleF(100,20,100,100);

      // Draw myRect to the screen.
      Rectangle myRect = Rectangle::Truncate( myRectF );
      e->Graphics->DrawRectangle( Pens::Black, myRect );

      // Create a Size structure.
      SizeF inflateSize = SizeF(100,0);

      // Inflate myRect.
      myRectF.Inflate( inflateSize );

      // Draw the inflated rectangle to the screen.
      myRect = Rectangle::Truncate( myRectF );
      e->Graphics->DrawRectangle( Pens::Red, myRect );
   }
public void RectangleFInflateExample(PaintEventArgs e)
{
             
    // Create a RectangleF structure.
    RectangleF myRectF = new RectangleF(100, 20, 100, 100);
             
    // Draw myRect to the screen.
    Rectangle myRect = Rectangle.Truncate(myRectF);
    e.Graphics.DrawRectangle(Pens.Black, myRect);
             
    // Create a Size structure.
    SizeF inflateSize = new SizeF(100, 0);
             
    // Inflate myRect.
    myRectF.Inflate(inflateSize);
             
    // Draw the inflated rectangle to the screen.
    myRect = Rectangle.Truncate(myRectF);
    e.Graphics.DrawRectangle(Pens.Red, myRect);
}
Public Sub RectangleFInflateExample(ByVal e As PaintEventArgs)

    ' Create a RectangleF structure.
    Dim myRectF As New RectangleF(100, 20, 100, 100)

    ' Draw myRect to the screen.
    Dim myRect As Rectangle = Rectangle.Truncate(myRectF)
    e.Graphics.DrawRectangle(Pens.Black, myRect)

    ' Create a Size structure.
    Dim inflateSize As New SizeF(100, 0)

    ' Inflate myRect.
    myRectF.Inflate(inflateSize)

    ' Draw the inflated rectangle to the screen.
    myRect = Rectangle.Truncate(myRectF)
    e.Graphics.DrawRectangle(Pens.Red, myRect)
End Sub

설명

이 메서드는 복사본이 아니라 이 사각형을 확대합니다. 사각형은 축을 따라 양방향으로 확대됩니다. 예를 들어 x축에서 50 x 50 사각형이 50으로 팽창되는 경우 결과 사각형의 길이는 150단원(원래 50개, 빼기 방향의 50개, 더하기 방향의 50개)으로 사각형의 기하학적 중심을 유지합니다.

추가 정보

적용 대상

Inflate(Single, Single)

Source:
RectangleF.cs
Source:
RectangleF.cs
Source:
RectangleF.cs

RectangleF 구조체를 지정된 크기만큼 확대합니다.

public:
 void Inflate(float x, float y);
public void Inflate (float x, float y);
member this.Inflate : single * single -> unit
Public Sub Inflate (x As Single, y As Single)

매개 변수

x
Single

RectangleF 구조체를 가로 방향으로 확장할 크기입니다.

y
Single

RectangleF 구조체를 세로 방향으로 확장할 크기입니다.

설명

이 메서드는 복사본이 아니라 이 사각형을 확대합니다. 사각형은 축을 따라 양방향으로 확대됩니다. 예를 들어 x축에서 50 x 50 사각형이 50으로 팽창되는 경우 결과 사각형의 길이는 150단원(원래 50개, 빼기 방향의 50개, 더하기 방향의 50개)으로 사각형의 기하학적 중심을 유지합니다.

x 또는 y 가 음수이 RectangleF 면 는 해당 방향으로 수축됩니다.

적용 대상

Inflate(RectangleF, Single, Single)

Source:
RectangleF.cs
Source:
RectangleF.cs
Source:
RectangleF.cs

지정된 RectangleF 구조체의 확대된 복사본을 만들고 반환합니다. 복사본은 지정된 크기만큼 확대되며 원래의 사각형은 수정되지 않고 남습니다.

public:
 static System::Drawing::RectangleF Inflate(System::Drawing::RectangleF rect, float x, float y);
public static System.Drawing.RectangleF Inflate (System.Drawing.RectangleF rect, float x, float y);
static member Inflate : System.Drawing.RectangleF * single * single -> System.Drawing.RectangleF
Public Shared Function Inflate (rect As RectangleF, x As Single, y As Single) As RectangleF

매개 변수

rect
RectangleF

복사할 RectangleF입니다. 이 사각형은 수정되지 않습니다.

x
Single

사각형 복사본을 가로 방향으로 확대할 크기입니다.

y
Single

사각형 복사본을 세로 방향으로 확대할 크기입니다.

반환

확대된 RectangleF입니다.

설명

이 메서드는 의 rect복사본을 만들고 복사본을 확대한 다음 확대된 복사본을 반환합니다. 사각형은 축을 따라 양방향으로 확대됩니다. 예를 들어 x축에서 50 x 50 사각형이 50으로 팽창되는 경우 결과 사각형의 길이는 150단원(원래 50개, 빼기 방향의 50개, 더하기 방향의 50개)으로 사각형의 기하학적 중심을 유지합니다.

적용 대상