GraphicsPath.AddEllipse Méthode

Définition

Ajoute une ellipse au tracé en cours.

Surcharges

AddEllipse(Rectangle)

Ajoute une ellipse au tracé en cours.

AddEllipse(RectangleF)

Ajoute une ellipse au tracé en cours.

AddEllipse(Int32, Int32, Int32, Int32)

Ajoute une ellipse au tracé en cours.

AddEllipse(Single, Single, Single, Single)

Ajoute une ellipse au tracé en cours.

AddEllipse(Rectangle)

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

Ajoute une ellipse au tracé en cours.

public:
 void AddEllipse(System::Drawing::Rectangle rect);
public void AddEllipse (System.Drawing.Rectangle rect);
member this.AddEllipse : System.Drawing.Rectangle -> unit
Public Sub AddEllipse (rect As Rectangle)

Paramètres

rect
Rectangle

Rectangle représentant le rectangle englobant qui définit l'ellipse.

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 rectangle englobant qui définit une ellipse.

Crée un chemin et ajoute l’ellipse au chemin.

Dessine le chemin d’accès à l’écran.

private:
   void AddEllipseExample( PaintEventArgs^ e )
   {
      // Create a path and add an ellipse.
      Rectangle myEllipse = Rectangle(20,20,100,50);
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddEllipse( myEllipse );

      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );
   }
private void AddEllipseExample(PaintEventArgs e)
{
             
    // Create a path and add an ellipse.
    Rectangle myEllipse = new Rectangle(20, 20, 100, 50);
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddEllipse(myEllipse);
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddEllipseExample(ByVal e As PaintEventArgs)

    ' Create a path and add an ellipse.
    Dim myEllipse As New Rectangle(20, 20, 100, 50)
    Dim myPath As New GraphicsPath
    myPath.AddEllipse(myEllipse)

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

S’applique à

AddEllipse(RectangleF)

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

Ajoute une ellipse au tracé en cours.

public:
 void AddEllipse(System::Drawing::RectangleF rect);
public void AddEllipse (System.Drawing.RectangleF rect);
member this.AddEllipse : System.Drawing.RectangleF -> unit
Public Sub AddEllipse (rect As RectangleF)

Paramètres

rect
RectangleF

RectangleF représentant le rectangle englobant qui définit l'ellipse.

Exemples

Pour obtenir un exemple, consultez AddEllipse(Rectangle).

S’applique à

AddEllipse(Int32, Int32, Int32, Int32)

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

Ajoute une ellipse au tracé en cours.

public:
 void AddEllipse(int x, int y, int width, int height);
public void AddEllipse (int x, int y, int width, int height);
member this.AddEllipse : int * int * int * int -> unit
Public Sub AddEllipse (x As Integer, y As Integer, width As Integer, height As Integer)

Paramètres

x
Int32

Coordonnée x de l'angle supérieur gauche du rectangle englobant qui définit l'ellipse.

y
Int32

Coordonnée y de l'angle supérieur gauche du rectangle englobant qui définit l'ellipse.

width
Int32

Largeur du rectangle englobant qui définit l'ellipse.

height
Int32

Hauteur du rectangle englobant qui définit l'ellipse.

Exemples

Pour obtenir un exemple, consultez AddEllipse(Rectangle).

S’applique à

AddEllipse(Single, Single, Single, Single)

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

Ajoute une ellipse au tracé en cours.

public:
 void AddEllipse(float x, float y, float width, float height);
public void AddEllipse (float x, float y, float width, float height);
member this.AddEllipse : single * single * single * single -> unit
Public Sub AddEllipse (x As Single, y As Single, width As Single, height As Single)

Paramètres

x
Single

Coordonnée x de l'angle supérieur gauche du rectangle englobant qui définit l'ellipse.

y
Single

Coordonnée y de l'angle supérieur gauche du rectangle englobant qui définit l'ellipse.

width
Single

Largeur du rectangle englobant qui définit l'ellipse.

height
Single

Hauteur du rectangle englobant qui définit l'ellipse.

Exemples

Pour obtenir un exemple, consultez AddEllipse(Rectangle).

S’applique à