Point.Offset Point.Offset Point.Offset Point.Offset Method

정의

Point를 지정된 크기만큼 변환합니다.Translates the Point by the specified amount.

오버로드

Offset(Int32, Int32) Offset(Int32, Int32) Offset(Int32, Int32) Offset(Int32, Int32)

Point를 지정된 크기만큼 변환합니다.Translates this Point by the specified amount.

Offset(Point) Offset(Point) Offset(Point) Offset(Point)

Point를 지정된 Point만큼 변환합니다.Translates this Point by the specified Point.

Offset(Int32, Int32) Offset(Int32, Int32) Offset(Int32, Int32) Offset(Int32, Int32)

Point를 지정된 크기만큼 변환합니다.Translates this Point by the specified amount.

public:
 void Offset(int dx, int dy);
public void Offset (int dx, int dy);
member this.Offset : int * int -> unit
Public Sub Offset (dx As Integer, dy As Integer)

매개 변수

dx
Int32 Int32 Int32 Int32

X 좌표를 오프셋할 크기입니다.The amount to offset the x-coordinate.

dy
Int32 Int32 Int32 Int32

Y 좌표를 오프셋할 크기입니다.The amount to offset the y-coordinate.

Offset(Point) Offset(Point) Offset(Point) Offset(Point)

Point를 지정된 Point만큼 변환합니다.Translates this Point by the specified Point.

public:
 void Offset(System::Drawing::Point p);
public void Offset (System.Drawing.Point p);
member this.Offset : System.Drawing.Point -> unit
Public Sub Offset (p As Point)

매개 변수

p
Point Point Point Point

Point를 오프셋하는 데 사용되는 Point입니다.The Point used offset this Point.

예제

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

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

설명

이 메서드를 조정 합니다 XY 값이 Point 의 합계를 XY 값이 Pointp합니다.This method adjusts the X and Y values of this Point to the sum of the X and Y values of this Point and p.

적용 대상