GraphicsPath.SetMarkers Método

Definición

Establece un marcador en este trazado GraphicsPath.

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

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, un OnPaint objeto de evento. El código crea una ruta de acceso y agrega varios primitivos a la ruta de acceso separada por marcadores y dibuja la ruta de acceso a la pantalla.

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

Comentarios

Este método crea un marcador en la ruta de acceso que se puede usar para separar secciones de la ruta de acceso. A continuación, puede usar los NextMarker métodos para recorrer en iteración los marcadores de la ruta de acceso.

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

Se aplica a