Rectangle.FromLTRB(Int32, Int32, Int32, Int32) 메서드

정의

지정된 가장자리 위치를 가진 Rectangle 구조체를 만듭니다.

public:
 static System::Drawing::Rectangle FromLTRB(int left, int top, int right, int bottom);
public static System.Drawing.Rectangle FromLTRB (int left, int top, int right, int bottom);
static member FromLTRB : int * int * int * int -> System.Drawing.Rectangle
Public Shared Function FromLTRB (left As Integer, top As Integer, right As Integer, bottom As Integer) As Rectangle

매개 변수

left
Int32

Rectangle 구조체의 왼쪽 위 모퉁이의 x좌표입니다.

top
Int32

Rectangle 구조체의 왼쪽 위 모퉁이의 y좌표입니다.

right
Int32

Rectangle 구조체의 오른쪽 아래 모퉁이의 x좌표입니다.

bottom
Int32

Rectangle 구조체의 오른쪽 아래 모퉁이의 y좌표입니다.

반환

이 메서드가 만드는 새 Rectangle를 반환합니다.

예제

다음 코드 예제를 사용 하 여 사각형을 만드는 방법을 보여 줍니다는 FromLTRB 메서드. 이 예제는 Windows Form과 함께 사용하도록 설계되었습니다. 이 코드를 양식에 붙여넣고 양식의 CreateARectangleFromLTRBPaint 이벤트를 처리할 때 메서드를 호출하여 으로 PaintEventArgs전달합니다e.

private:
   void CreateARectangleFromLTRB( PaintEventArgs^ e )
   {
      Rectangle myRectangle = Rectangle::FromLTRB( 40, 40, 140, 240 );
      e->Graphics->DrawRectangle( SystemPens::ControlText, myRectangle );
   }
private void CreateARectangleFromLTRB(PaintEventArgs e)
{
    Rectangle myRectangle = Rectangle.FromLTRB(40, 40, 140, 240);
    e.Graphics.DrawRectangle(SystemPens.ControlText, myRectangle);
}
Private Sub CreateARectangleFromLTRB(ByVal e As PaintEventArgs)
    Dim myRectangle As Rectangle = Rectangle.FromLTRB(40, 40, 140, 240)
    e.Graphics.DrawRectangle(SystemPens.ControlText, myRectangle)
End Sub

설명

이 메서드는 지정된 왼쪽 위와 오른쪽 아래 모서리를 사용하여 을 만듭니다 Rectangle .

적용 대상