다음을 통해 공유


Rectangle.FromLTRB 메서드

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

네임스페이스: System.Drawing
어셈블리: System.Drawing(system.drawing.dll)

구문

‘선언
Public Shared Function FromLTRB ( _
    left As Integer, _
    top As Integer, _
    right As Integer, _
    bottom As Integer _
) As Rectangle
‘사용 방법
Dim left As Integer
Dim top As Integer
Dim right As Integer
Dim bottom As Integer
Dim returnValue As Rectangle

returnValue = Rectangle.FromLTRB(left, top, right, bottom)
public static Rectangle FromLTRB (
    int left,
    int top,
    int right,
    int bottom
)
public:
static Rectangle FromLTRB (
    int left, 
    int top, 
    int right, 
    int bottom
)
public static Rectangle FromLTRB (
    int left, 
    int top, 
    int right, 
    int bottom
)
public static function FromLTRB (
    left : int, 
    top : int, 
    right : int, 
    bottom : int
) : Rectangle

매개 변수

  • left
    Rectangle 구조체의 왼쪽 위 모퉁이의 x좌표입니다.
  • top
    Rectangle 구조체의 왼쪽 위 모퉁이의 y좌표입니다.
  • right
    Rectangle 구조체의 오른쪽 아래 모퉁이의 x좌표입니다.
  • bottom
    Rectangle 구조체의 오른쪽 아래 모퉁이의 y좌표입니다.

반환 값

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

설명

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

예제

다음 코드 예제에서는 FromLTRB 메서드를 사용하여 사각형을 만드는 방법을 보여 줍니다. 이 예제는 Windows Form과 함께 사용해야 합니다. 폼에 이 코드를 붙여넣고 폼의 Paint 이벤트를 처리할 때 CreateARectangleFromLTRB 메서드를 호출하여 e를 PaintEventArgs로 전달합니다.

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

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Rectangle 구조체
Rectangle 멤버
System.Drawing 네임스페이스