GraphicsPath.SetMarkers 메서드

정의

GraphicsPath에 마커를 설정합니다.

public:
 void SetMarkers();
public void SetMarkers ();
member this.SetMarkers : unit -> unit
Public Sub SetMarkers ()

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 개체인 가 OnPaint 필요합니다PaintEventArgse. 이 코드는 경로를 만들고 표식으로 구분된 경로에 여러 기본 형식을 추가하고 화면에 경로를 그립니다.

private:
   void SetMarkersExample( PaintEventArgs^ e )
   {
      // Create a path and set two markers.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddLine( Point(0,0), Point(50,50) );
      myPath->SetMarkers();
      Rectangle rect = Rectangle(50,50,50,50);
      myPath->AddRectangle( rect );
      myPath->SetMarkers();
      myPath->AddEllipse( 100, 100, 100, 50 );

      // Draw the path to screen.
      e->Graphics->DrawPath( gcnew Pen( Color::Black,2.0f ), myPath );
   }
private void SetMarkersExample(PaintEventArgs e)
{
             
    // Create a path and set two markers.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddLine(new Point(0, 0), new Point(50, 50));
    myPath.SetMarkers();
    Rectangle rect = new Rectangle(50, 50, 50, 50);
    myPath.AddRectangle(rect);
    myPath.SetMarkers();
    myPath.AddEllipse(100, 100, 100, 50);
             
    // Draw the path to screen.
    e.Graphics.DrawPath(new Pen(Color.Black, 2), myPath);
}
Public Sub SetMarkersExample(ByVal e As PaintEventArgs)

    ' Create a path and set two markers.
    Dim myPath As New GraphicsPath
    myPath.AddLine(New Point(0, 0), New Point(50, 50))
    myPath.SetMarkers()
    Dim rect As New Rectangle(50, 50, 50, 50)
    myPath.AddRectangle(rect)
    myPath.SetMarkers()
    myPath.AddEllipse(100, 100, 100, 50)

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

설명

이 메서드는 경로의 섹션을 구분하는 데 사용할 수 있는 표식을 경로에 만듭니다. 그런 다음 메서드를 NextMarker 사용하여 경로의 마커를 반복할 수 있습니다.

표식은 하위 경로 그룹을 구분하는 데 사용됩니다. 경로의 두 표식 사이에 하나 이상의 하위 경로를 포함할 수 있습니다.

적용 대상