Graphics.DrawPath(Pen, GraphicsPath) Metodo
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Disegna un GraphicsPath.
public:
void DrawPath(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::GraphicsPath ^ path);
public void DrawPath(System.Drawing.Pen pen, System.Drawing.Drawing2D.GraphicsPath path);
member this.DrawPath : System.Drawing.Pen * System.Drawing.Drawing2D.GraphicsPath -> unit
Public Sub DrawPath (pen As Pen, path As GraphicsPath)
- path
- GraphicsPath
GraphicsPath da disegnare.
L'esempio di codice seguente è progettato per l'uso con Windows Form e richiede PaintEventArgse
, che è un parametro del gestore eventi Paint. Il codice esegue le azioni seguenti:
Crea un oggetto percorso grafico e aggiunge un'ellisse.
Crea una penna nera.
Disegna il percorso grafico sullo schermo.
public:
void DrawPathEllipse( PaintEventArgs^ e )
{
// Create graphics path object and add ellipse.
GraphicsPath^ graphPath = gcnew GraphicsPath;
graphPath->AddEllipse( 0, 0, 200, 100 );
// Create pen.
Pen^ blackPen = gcnew Pen( Color::Black,3.0f );
// Draw graphics path to screen.
e->Graphics->DrawPath( blackPen, graphPath );
}
public void DrawPathEllipse(PaintEventArgs e)
{
// Create graphics path object and add ellipse.
GraphicsPath graphPath = new GraphicsPath();
graphPath.AddEllipse(0, 0, 200, 100);
// Create pen.
Pen blackPen = new Pen(Color.Black, 3);
// Draw graphics path to screen.
e.Graphics.DrawPath(blackPen, graphPath);
}
Public Sub DrawPathEllipse(ByVal e As PaintEventArgs)
' Create graphics path object and add ellipse.
Dim graphPath As New GraphicsPath
graphPath.AddEllipse(0, 0, 200, 100)
' Create pen.
Dim blackPen As New Pen(Color.Black, 3)
' Draw graphics path to screen.
e.Graphics.DrawPath(blackPen, graphPath)
End Sub
La trasformazione corrente nel contesto grafico viene applicata al GraphicsPath prima che venga disegnata.
Prodotto | Versioni |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: