GraphicsPath.SetMarkers Método

Definição

Define um marcador neste GraphicsPath.

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

Exemplos

O exemplo de código a seguir foi projetado para uso com Windows Forms e requer PaintEventArgse, um OnPaint objeto de evento. O código cria um caminho e adiciona vários primitivos ao caminho separado por marcadores e desenha o caminho para a tela.

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

Comentários

Esse método cria um marcador no caminho que pode ser usado para separar seções do caminho. Em seguida, você pode usar os NextMarker métodos para iterar por meio dos marcadores no caminho.

Os marcadores são usados para separar grupos de subcaminhos. Um ou mais subcaminhos podem ser contidos entre dois marcadores no caminho.

Aplica-se a