GraphicsPath.ClearMarkers Método

Definición

Borra todos los marcadores de este trazado.

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

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgs e, un OnPaint objeto de evento. El código realiza las siguientes acciones:

  • Crea una ruta de acceso.

  • Agrega varios objetos a la ruta de acceso.

  • Agrega marcadores a la ruta de acceso.

  • Borra todos los marcadores de la ruta de acceso.

  • Dibuja la ruta de acceso a la pantalla.

private:
   void ClearMarkersExample( PaintEventArgs^ e )
   {
      // Set several markers in a path.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddEllipse( 0, 0, 100, 200 );
      myPath->SetMarkers();
      myPath->AddLine( Point(100,100), Point(200,100) );
      Rectangle rect = Rectangle(200,0,100,200);
      myPath->AddRectangle( rect );
      myPath->SetMarkers();
      myPath->AddLine( Point(250,200), Point(250,300) );
      myPath->SetMarkers();

      // Clear the markers.
      myPath->ClearMarkers();

      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );
   }
private void ClearMarkersExample(PaintEventArgs e)
{
             
    // Set several markers in a path.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddEllipse(0, 0, 100, 200);
    myPath.SetMarkers();
    myPath.AddLine(new Point(100, 100), new Point(200, 100));
    Rectangle rect = new Rectangle(200, 0, 100, 200);
    myPath.AddRectangle(rect);
    myPath.SetMarkers();
    myPath.AddLine(new Point(250, 200), new Point(250, 300));
    myPath.SetMarkers();
             
    // Clear the markers.
    myPath.ClearMarkers();
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
Public Sub ClearMarkersExample(ByVal e As PaintEventArgs)

    ' Set several markers in a path.
    Dim myPath As New GraphicsPath
    myPath.AddEllipse(0, 0, 100, 200)
    myPath.SetMarkers()
    myPath.AddLine(New Point(100, 100), New Point(200, 100))
    Dim rect As New Rectangle(200, 0, 100, 200)
    myPath.AddRectangle(rect)
    myPath.SetMarkers()
    myPath.AddLine(New Point(250, 200), New Point(250, 300))
    myPath.SetMarkers()

    ' Clear the markers.
    myPath.ClearMarkers()

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

Comentarios

Use el SetMarkers método para crear un marcador en la ubicación actual de .GraphicsPath Use el NextMarker método para recorrer en iteración los marcadores existentes en una ruta de acceso.

Los marcadores se usan para separar grupos de subrutas. Una o varias subrutas se pueden contener entre dos marcadores.

Se aplica a