Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Startet eine neue Figur, ohne die aktuelle zu schließen. Alle nachfolgenden Punkte, die dem Pfad hinzugefügt werden, werden dieser neuen Figur hinzugefügt.
Namespace: System.Drawing.Drawing2D
Assembly: System.Drawing (in system.drawing.dll)
Syntax
'Declaration
Public Sub StartFigure
'Usage
Dim instance As GraphicsPath
instance.StartFigure
public void StartFigure ()
public:
void StartFigure ()
public void StartFigure ()
public function StartFigure ()
Hinweise
Der Benutzer muss die ursprünglichen Punkte beibehalten, wenn diese erforderlich sind. Da die ursprünglichen Punkte intern in kubische Bézierkontrollpunkte konvertiert werden, gibt es keinen Rückgabemechanismus für sie.
Diese Methode beginnt im Pfad einen neuen untergeordneten Pfad. Sie können einen Pfad mithilfe untergeordneter Pfade in Abschnitte unterteilen und die untergeordneten Pfade unter Verwendung der GraphicsPathIterator-Klasse durchlaufen.
Beispiel
Das folgende Codebeispiel ist für die Verwendung mit Windows Forms vorgesehen und erfordert das OnPaint-Ereignisobjekt PaintEventArgse. Der Code führt die folgenden Aktionen aus:
Erstellt einen Pfad.
Fügt zwei Gruppen von Figuren hinzu. Bei der ersten Figurengruppe werden vier geometrische Grundformen zu zwei Figuren verbunden. Bei der zweiten Figurengruppe werden dieselben, allerdings auf der y-Achse verschobenen vier geometrischen Grundformen zu drei Figuren verbunden.
Zeichnet alle Figuren auf dem Bildschirm.
Beachten Sie die unterschiedliche Wiedergabe der beiden Figurengruppen.
Public Sub StartFigureExample(ByVal e As PaintEventArgs)
' Create a GraphicsPath object.
Dim myPath As New GraphicsPath
' First set of figures.
myPath.StartFigure()
myPath.AddArc(10, 10, 50, 50, 0, 270)
myPath.AddLine(New Point(50, 0), New Point(100, 50))
myPath.AddArc(50, 100, 75, 75, 0, 270)
myPath.CloseFigure()
myPath.StartFigure()
myPath.AddArc(100, 10, 50, 50, 0, 270)
' Second set of figures.
myPath.StartFigure()
myPath.AddArc(10, 200, 50, 50, 0, 270)
myPath.CloseFigure()
myPath.StartFigure()
myPath.AddLine(New Point(60, 200), New Point(110, 250))
myPath.AddArc(50, 300, 75, 75, 0, 270)
myPath.CloseFigure()
myPath.StartFigure()
myPath.AddArc(100, 200, 50, 50, 0, 270)
' Draw the path to the screen.
e.Graphics.DrawPath(New Pen(Color.Black), myPath)
End Sub
public void StartFigureExample(PaintEventArgs e)
{
// Create a GraphicsPath object.
GraphicsPath myPath = new GraphicsPath();
// First set of figures.
myPath.StartFigure();
myPath.AddArc(10, 10, 50, 50, 0, 270);
myPath.AddLine(new Point(50, 0), new Point(100, 50));
myPath.AddArc(50, 100, 75, 75, 0, 270);
myPath.CloseFigure();
myPath.StartFigure();
myPath.AddArc(100, 10, 50, 50, 0, 270);
// Second set of figures.
myPath.StartFigure();
myPath.AddArc(10, 200, 50, 50, 0, 270);
myPath.CloseFigure();
myPath.StartFigure();
myPath.AddLine(new Point(60, 200), new Point(110, 250));
myPath.AddArc(50, 300, 75, 75, 0, 270);
myPath.CloseFigure();
myPath.StartFigure();
myPath.AddArc(100, 200, 50, 50, 0, 270);
// Draw the path to the screen.
e.Graphics.DrawPath(new Pen(Color.Black), myPath);
}
// End StartFigureExample
public:
void StartFigureExample( PaintEventArgs^ e )
{
// Create a GraphicsPath object.
GraphicsPath^ myPath = gcnew GraphicsPath;
// First set of figures.
myPath->StartFigure();
myPath->AddArc( 10, 10, 50, 50, 0, 270 );
myPath->AddLine( Point(50,0), Point(100,50) );
myPath->AddArc( 50, 100, 75, 75, 0, 270 );
myPath->CloseFigure();
myPath->StartFigure();
myPath->AddArc( 100, 10, 50, 50, 0, 270 );
// Second set of figures.
myPath->StartFigure();
myPath->AddArc( 10, 200, 50, 50, 0, 270 );
myPath->CloseFigure();
myPath->StartFigure();
myPath->AddLine( Point(60,200), Point(110,250) );
myPath->AddArc( 50, 300, 75, 75, 0, 270 );
myPath->CloseFigure();
myPath->StartFigure();
myPath->AddArc( 100, 200, 50, 50, 0, 270 );
// Draw the path to the screen.
e->Graphics->DrawPath( gcnew Pen( Color::Black ), myPath );
}
// End StartFigureExample
public void StartFigureExample(PaintEventArgs e)
{
// Create a GraphicsPath object.
GraphicsPath myPath = new GraphicsPath();
// First set of figures.
myPath.StartFigure();
myPath.AddArc(10, 10, 50, 50, 0, 270);
myPath.AddLine(new Point(50, 0), new Point(100, 50));
myPath.AddArc(50, 100, 75, 75, 0, 270);
myPath.CloseFigure();
myPath.StartFigure();
myPath.AddArc(100, 10, 50, 50, 0, 270);
// Second set of figures.
myPath.StartFigure();
myPath.AddArc(10, 200, 50, 50, 0, 270);
myPath.CloseFigure();
myPath.StartFigure();
myPath.AddLine(new Point(60, 200), new Point(110, 250));
myPath.AddArc(50, 300, 75, 75, 0, 270);
myPath.CloseFigure();
myPath.StartFigure();
myPath.AddArc(100, 200, 50, 50, 0, 270);
// Draw the path to the screen.
e.get_Graphics().DrawPath(new Pen(Color.get_Black()), myPath);
} //StartFigureExample
// End StartFigureExample
Plattformen
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
GraphicsPath-Klasse
GraphicsPath-Member
System.Drawing.Drawing2D-Namespace