GraphicsPath.AddLine 메서드

정의

선 세그먼트를 이 GraphicsPath에 추가합니다.

오버로드

AddLine(Int32, Int32, Int32, Int32)

선 세그먼트를 현재 그림에 추가합니다.

AddLine(Single, Single, Single, Single)

선 세그먼트를 이 GraphicsPath에 추가합니다.

AddLine(Point, Point)

선 세그먼트를 이 GraphicsPath에 추가합니다.

AddLine(PointF, PointF)

선 세그먼트를 이 GraphicsPath에 추가합니다.

AddLine(Int32, Int32, Int32, Int32)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

선 세그먼트를 현재 그림에 추가합니다.

public:
 void AddLine(int x1, int y1, int x2, int y2);
public void AddLine (int x1, int y1, int x2, int y2);
member this.AddLine : int * int * int * int -> unit
Public Sub AddLine (x1 As Integer, y1 As Integer, x2 As Integer, y2 As Integer)

매개 변수

x1
Int32

선의 시작점에 대한 X좌표입니다.

y1
Int32

선의 시작점에 대한 Y좌표입니다.

x2
Int32

선의 엔드포인트에 대한 X좌표입니다.

y2
Int32

선의 엔드포인트에 대한 Y좌표입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 개체인 가 OnPaint 필요합니다PaintEventArgse. 이 코드는 경로를 만들고 삼각형을 형성하는 세 줄을 추가한 다음 화면에 경로를 그립니다.

private:
   void AddLineExample( PaintEventArgs^ e )
   {
      //Create a path and add a symetrical triangle using AddLine.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddLine( 30, 30, 60, 60 );
      myPath->AddLine( 60, 60, 0, 60 );
      myPath->AddLine( 0, 60, 30, 30 );

      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );
   }
private void AddLineExample(PaintEventArgs e)
{
             
    //Create a path and add a symmetrical triangle using AddLine.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddLine(30, 30, 60, 60);
    myPath.AddLine(60, 60, 0, 60);
    myPath.AddLine(0, 60, 30, 30);
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddLineExample(ByVal e As PaintEventArgs)

    ' Create a path and add a symmetrical triangle using AddLine.
    Dim myPath As New GraphicsPath
    myPath.AddLine(30, 30, 60, 60)
    myPath.AddLine(60, 60, 0, 60)
    myPath.AddLine(0, 60, 30, 30)

    ' Draw the path to the screen.
    Dim myPen As New Pen(Color.Black, 2)
    e.Graphics.DrawPath(myPen, myPath)
End Sub

설명

이 메서드는 지정된 점으로 정의된 선 세그먼트를 현재 그림의 끝에 추가합니다. 에 이전 선 또는 곡선 GraphicsPath이 있는 경우 경로의 마지막 점을 새 선 세그먼트의 첫 번째 점에 연결하기 위해 선 세그먼트가 그려집니다.

적용 대상

AddLine(Single, Single, Single, Single)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

선 세그먼트를 이 GraphicsPath에 추가합니다.

public:
 void AddLine(float x1, float y1, float x2, float y2);
public void AddLine (float x1, float y1, float x2, float y2);
member this.AddLine : single * single * single * single -> unit
Public Sub AddLine (x1 As Single, y1 As Single, x2 As Single, y2 As Single)

매개 변수

x1
Single

선의 시작점에 대한 X좌표입니다.

y1
Single

선의 시작점에 대한 Y좌표입니다.

x2
Single

선의 엔드포인트에 대한 X좌표입니다.

y2
Single

선의 엔드포인트에 대한 Y좌표입니다.

예제

예제를 보려면 AddLine(Int32, Int32, Int32, Int32)를 참조하세요.

설명

이 메서드는 지정된 점으로 정의된 선 세그먼트를 이 GraphicsPath의 끝에 추가합니다. 에 이전 선 또는 곡선 GraphicsPath이 있는 경우 경로의 마지막 점을 새 선 세그먼트의 첫 번째 점에 연결하기 위해 선 세그먼트가 그려집니다.

적용 대상

AddLine(Point, Point)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

선 세그먼트를 이 GraphicsPath에 추가합니다.

public:
 void AddLine(System::Drawing::Point pt1, System::Drawing::Point pt2);
public void AddLine (System.Drawing.Point pt1, System.Drawing.Point pt2);
member this.AddLine : System.Drawing.Point * System.Drawing.Point -> unit
Public Sub AddLine (pt1 As Point, pt2 As Point)

매개 변수

pt1
Point

선의 시작점을 나타내는 Point입니다.

pt2
Point

선의 엔드포인트를 나타내는 Point입니다.

예제

예제를 보려면 AddLine(Int32, Int32, Int32, Int32)를 참조하세요.

설명

이 메서드는 지정된 점으로 정의된 선 세그먼트를 이 GraphicsPath의 끝에 추가합니다. 에 이전 선 또는 곡선 GraphicsPath이 있는 경우 경로의 마지막 점을 새 선 세그먼트의 첫 번째 점에 연결하기 위해 선 세그먼트가 그려집니다.

적용 대상

AddLine(PointF, PointF)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

선 세그먼트를 이 GraphicsPath에 추가합니다.

public:
 void AddLine(System::Drawing::PointF pt1, System::Drawing::PointF pt2);
public void AddLine (System.Drawing.PointF pt1, System.Drawing.PointF pt2);
member this.AddLine : System.Drawing.PointF * System.Drawing.PointF -> unit
Public Sub AddLine (pt1 As PointF, pt2 As PointF)

매개 변수

pt1
PointF

선의 시작점을 나타내는 PointF입니다.

pt2
PointF

선의 엔드포인트를 나타내는 PointF입니다.

예제

예제를 보려면 AddLine(Int32, Int32, Int32, Int32)를 참조하세요.

설명

이 메서드는 지정된 점으로 정의된 선 세그먼트를 이 GraphicsPath의 끝에 추가합니다. 에 이전 선 또는 곡선 GraphicsPath이 있는 경우 경로의 마지막 점을 새 선 세그먼트의 첫 번째 점에 연결하기 위해 선 세그먼트가 그려집니다.

적용 대상