GraphicsPath.Widen Méthode

Définition

Remplace ce tracé par des courbes englobant la zone remplie lorsque ce tracé est dessiné à l'aide du stylet spécifié.

Surcharges

Widen(Pen, Matrix)

Ajoute un contour supplémentaire au GraphicsPath.

Widen(Pen)

Ajoute un contour supplémentaire au tracé.

Widen(Pen, Matrix, Single)

Remplace ce GraphicsPath par des courbes englobant la zone remplie lorsque ce tracé est dessiné à l'aide du stylet spécifié.

Widen(Pen, Matrix)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Ajoute un contour supplémentaire au GraphicsPath.

public:
 void Widen(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::Matrix ^ matrix);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix? matrix);
member this.Widen : System.Drawing.Pen * System.Drawing.Drawing2D.Matrix -> unit
Public Sub Widen (pen As Pen, matrix As Matrix)

Paramètres

pen
Pen

Pen qui spécifie la largeur entre le contour d'origine du tracé et le nouveau contour créé par cette méthode.

matrix
Matrix

Matrix spécifiant la transformation à appliquer au tracé avant de l'élargir.

Exemples

Pour obtenir un exemple, consultez Widen(Pen, Matrix, Single).

Remarques

Cette méthode crée un plan autour des lignes d’origine dans ce GraphicsPath, avec une distance entre les lignes existantes et le nouveau contour égale à celle de la largeur du Pen utilisé dans l’appel à Widen. Si vous souhaitez remplir l’espace entre les lignes, vous devez utiliser plutôt que FillPath le DrawPath.

S’applique à

Widen(Pen)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Ajoute un contour supplémentaire au tracé.

public:
 void Widen(System::Drawing::Pen ^ pen);
public void Widen (System.Drawing.Pen pen);
member this.Widen : System.Drawing.Pen -> unit
Public Sub Widen (pen As Pen)

Paramètres

pen
Pen

Pen qui spécifie la largeur entre le contour d'origine du tracé et le nouveau contour créé par cette méthode.

Exemples

Pour obtenir un exemple, consultez Widen(Pen, Matrix, Single).

Remarques

Cette méthode crée un plan autour des lignes d’origine dans ce GraphicsPath, avec une distance entre les lignes existantes et le nouveau contour égale à celle de la largeur du Pen utilisé dans l’appel à Widen. Si vous souhaitez remplir l’espace entre les lignes, vous devez utiliser plutôt que FillPath le DrawPath.

S’applique à

Widen(Pen, Matrix, Single)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

Remplace ce GraphicsPath par des courbes englobant la zone remplie lorsque ce tracé est dessiné à l'aide du stylet spécifié.

public:
 void Widen(System::Drawing::Pen ^ pen, System::Drawing::Drawing2D::Matrix ^ matrix, float flatness);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix matrix, float flatness);
public void Widen (System.Drawing.Pen pen, System.Drawing.Drawing2D.Matrix? matrix, float flatness);
member this.Widen : System.Drawing.Pen * System.Drawing.Drawing2D.Matrix * single -> unit
Public Sub Widen (pen As Pen, matrix As Matrix, flatness As Single)

Paramètres

pen
Pen

Pen qui spécifie la largeur entre le contour d'origine du tracé et le nouveau contour créé par cette méthode.

matrix
Matrix

Matrix spécifiant la transformation à appliquer au tracé avant de l'élargir.

flatness
Single

Valeur qui spécifie l'apparence à deux dimensions des courbes.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse, un objet d’événementOnPaint. Le code effectue les actions suivantes :

  • Crée un chemin et ajoute deux points de suspension au chemin.

  • Dessine le chemin en noir.

  • Élargit le chemin d’accès.

  • Dessine le chemin en rouge.

Notez que le deuxième rendu utilise FillPath au lieu de DrawPath, et que par conséquent, la figure rendue a le contour rempli.

private:
   void WidenExample( PaintEventArgs^ e )
   {
      // Create a path and add two ellipses.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddEllipse( 0, 0, 100, 100 );
      myPath->AddEllipse( 100, 0, 100, 100 );

      // Draw the original ellipses to the screen in black.
      e->Graphics->DrawPath( Pens::Black, myPath );

      // Widen the path.
      Pen^ widenPen = gcnew Pen( Color::Black,10.0f );
      Matrix^ widenMatrix = gcnew Matrix;
      widenMatrix->Translate( 50, 50 );
      myPath->Widen( widenPen, widenMatrix, 1.0f );

      // Draw the widened path to the screen in red.
      e->Graphics->FillPath( gcnew SolidBrush( Color::Red ), myPath );
   }
private void WidenExample(PaintEventArgs e)
{
             
    // Create a path and add two ellipses.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddEllipse(0, 0, 100, 100);
    myPath.AddEllipse(100, 0, 100, 100);
             
    // Draw the original ellipses to the screen in black.
    e.Graphics.DrawPath(Pens.Black, myPath);
             
    // Widen the path.
    Pen widenPen = new Pen(Color.Black, 10);
    Matrix widenMatrix = new Matrix();
    widenMatrix.Translate(50, 50);
    myPath.Widen(widenPen, widenMatrix, 1.0f);
             
    // Draw the widened path to the screen in red.
    e.Graphics.FillPath(new SolidBrush(Color.Red), myPath);
}
Public Sub WidenExample(ByVal e As PaintEventArgs)
    Dim myPath As New GraphicsPath
    myPath.AddEllipse(0, 0, 100, 100)
    myPath.AddEllipse(100, 0, 100, 100)
    e.Graphics.DrawPath(Pens.Black, myPath)
    Dim widenPen As New Pen(Color.Black, 10)
    Dim widenMatrix As New Matrix
    widenMatrix.Translate(50, 50)
    myPath.Widen(widenPen, widenMatrix, 1.0F)
    ' Sets tension for curves.
    e.Graphics.FillPath(New SolidBrush(Color.Red), myPath)
End Sub

Remarques

Cette méthode crée un plan autour des lignes d’origine dans ce GraphicsPath, avec une distance entre les lignes existantes et le nouveau contour égale à celle de la largeur du Pen utilisé dans l’appel à Widen. Si vous souhaitez remplir l’espace entre les lignes, vous devez utiliser plutôt que FillPath le DrawPath.

S’applique à