Point.Add(Point, Size) Point.Add(Point, Size) Point.Add(Point, Size) Point.Add(Point, Size) Method

정의

지정된 Size를 지정된 Point에 더합니다.Adds the specified Size to the specified Point.

public:
 static System::Drawing::Point Add(System::Drawing::Point pt, System::Drawing::Size sz);
public static System.Drawing.Point Add (System.Drawing.Point pt, System.Drawing.Size sz);
static member Add : System.Drawing.Point * System.Drawing.Size -> System.Drawing.Point
Public Shared Function Add (pt As Point, sz As Size) As Point

매개 변수

pt
Point Point Point Point

추가할 Point입니다.The Point to add.

sz
Size Size Size Size

더할 Size입니다.The Size to add

반환

더하기 연산의 결과인 Point입니다.The Point that is the result of the addition operation.

예제

다음 예제에서는 Add 메서드를 사용하는 방법을 보여 줍니다.The following example shows how to use the Add method. 이 예제를 실행 하려면 Windows 폼에 붙여 넣습니다.To run this example, paste it into a Windows Form. 양식의 처리 Paint 이벤트 및 호출 합니다 AddPoint 메서드에서 Paint 전달 하는 이벤트 처리 메서드를 e 으로 PaintEventArgs입니다.Handle the form's Paint event and call the AddPoint method from the Paint event-handling method, passing e as PaintEventArgs.

private void AddPoint(PaintEventArgs e)
{
    Point point1 = new Point(10, 10);
    Point point2 = Point.Add(point1, new Size(250,0));
    e.Graphics.DrawLine(Pens.Red, point1, point2);
}
Private Sub AddPoint(ByVal e As PaintEventArgs) 
    Dim point1 As New Point(10, 10)
    Dim point2 As Point = Point.Add(point1, New Size(250, 0))
    e.Graphics.DrawLine(Pens.Red, point1, point2)

End Sub

설명

Add 추가 WidthHeight 지정 된 SizeXY 지정한 요소의 값입니다.The Add adds the Width and Height of the specified Size to the X and Y values of the specified point.

적용 대상