Size 생성자

정의

지정된 Size에서 Point 구조체의 새 인스턴스를 초기화합니다.

오버로드

Size(Point)

지정된 Size 구조체에서 Point 구조체의 새 인스턴스를 초기화합니다.

Size(Int32, Int32)

지정된 크기에서 Size 구조체의 새 인스턴스를 초기화합니다.

Size(Point)

Source:
Size.cs
Source:
Size.cs
Source:
Size.cs

지정된 Size 구조체에서 Point 구조체의 새 인스턴스를 초기화합니다.

public:
 Size(System::Drawing::Point pt);
public Size (System.Drawing.Point pt);
new System.Drawing.Size : System.Drawing.Point -> System.Drawing.Size
Public Sub New (pt As Point)

매개 변수

pt
Point

Point 구조체를 초기화할 Size 구조체입니다.

적용 대상

Size(Int32, Int32)

Source:
Size.cs
Source:
Size.cs
Source:
Size.cs

지정된 크기에서 Size 구조체의 새 인스턴스를 초기화합니다.

public:
 Size(int width, int height);
public Size (int width, int height);
new System.Drawing.Size : int * int -> System.Drawing.Size
Public Sub New (width As Integer, height As Integer)

매개 변수

width
Int32

Size의 너비 구성 요소입니다.

height
Int32

Size의 높이 구성 요소입니다.

예제

다음 코드 예제를 사용 Point.Point 하는 방법에 설명 합니다 및 Size 생성자 및 System.Drawing.ContentAlignment 열거형입니다. 이 예제를 실행하려면 이 코드를 라는 Label1 레이블이 포함된 Windows Form에 붙여넣고 폼의 생성자에서 메서드를 호출 InitializeLabel1 합니다.

void InitializeLabel1()
{
   // Set a border.
   Label1->BorderStyle = BorderStyle::FixedSingle;
   
   // Set the size, constructing a size from two integers.
   Label1->Size = System::Drawing::Size( 100, 50 );
   
   // Set the location, constructing a point from a 32-bit integer
   // (using hexadecimal).
   Label1->Location = Point(0x280028);
   
   // Set and align the text on the lower-right side of the label.
   Label1->TextAlign = ContentAlignment::BottomRight;
   Label1->Text = "Bottom Right Alignment";
}
private void InitializeLabel1()
{
    // Set a border.
    Label1.BorderStyle = BorderStyle.FixedSingle;

    // Set the size, constructing a size from two integers.
    Label1.Size = new Size(100, 50);

    // Set the location, constructing a point from a 32-bit integer
    // (using hexadecimal).
    Label1.Location = new Point(0x280028);

    // Set and align the text on the lower-right side of the label.
    Label1.TextAlign = ContentAlignment.BottomRight;
    Label1.Text = "Bottom Right Alignment";
}
Private Sub InitializeLabel1()

    ' Set a border.
    Label1.BorderStyle = BorderStyle.FixedSingle

    ' Set the size, constructing a size from two integers.
    Label1.Size = New Size(100, 50)

    ' Set the location, constructing a point from a 32-bit integer
    ' (using hexadecimal).
    Label1.Location = New Point(&H280028)

    ' Set and align the text on the lower-right side of the label.
    Label1.TextAlign = ContentAlignment.BottomRight
    Label1.Text = "Bottom Right Alignment"
End Sub

적용 대상