GraphicsPath.AddEllipse GraphicsPath.AddEllipse GraphicsPath.AddEllipse GraphicsPath.AddEllipse Method

Definition

Adds an ellipse to the current path.

Overloads

AddEllipse(Rectangle) AddEllipse(Rectangle) AddEllipse(Rectangle) AddEllipse(Rectangle)

Adds an ellipse to the current path.

AddEllipse(RectangleF) AddEllipse(RectangleF) AddEllipse(RectangleF) AddEllipse(RectangleF)

Adds an ellipse to the current path.

AddEllipse(Int32, Int32, Int32, Int32) AddEllipse(Int32, Int32, Int32, Int32) AddEllipse(Int32, Int32, Int32, Int32) AddEllipse(Int32, Int32, Int32, Int32)

Adds an ellipse to the current path.

AddEllipse(Single, Single, Single, Single) AddEllipse(Single, Single, Single, Single) AddEllipse(Single, Single, Single, Single) AddEllipse(Single, Single, Single, Single)

Adds an ellipse to the current path.

AddEllipse(Rectangle) AddEllipse(Rectangle) AddEllipse(Rectangle) AddEllipse(Rectangle)

Adds an ellipse to the current path.

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)

Parameters

rect
Rectangle Rectangle Rectangle Rectangle

A Rectangle that represents the bounding rectangle that defines the ellipse.

Examples

The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, an OnPaint event object. The code performs the following actions:

Creates a bounding rectangle that defines an ellipse.

Creates a path and adds the ellipse to the path.

Draws the path to screen.

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

AddEllipse(RectangleF) AddEllipse(RectangleF) AddEllipse(RectangleF) AddEllipse(RectangleF)

Adds an ellipse to the current path.

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)

Parameters

rect
RectangleF RectangleF RectangleF RectangleF

A RectangleF that represents the bounding rectangle that defines the ellipse.

Examples

For an example, see AddEllipse(Rectangle).

AddEllipse(Int32, Int32, Int32, Int32) AddEllipse(Int32, Int32, Int32, Int32) AddEllipse(Int32, Int32, Int32, Int32) AddEllipse(Int32, Int32, Int32, Int32)

Adds an ellipse to the current path.

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)

Parameters

x
Int32 Int32 Int32 Int32

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y
Int32 Int32 Int32 Int32

The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

width
Int32 Int32 Int32 Int32

The width of the bounding rectangle that defines the ellipse.

height
Int32 Int32 Int32 Int32

The height of the bounding rectangle that defines the ellipse.

Examples

For an example, see AddEllipse(Rectangle).

AddEllipse(Single, Single, Single, Single) AddEllipse(Single, Single, Single, Single) AddEllipse(Single, Single, Single, Single) AddEllipse(Single, Single, Single, Single)

Adds an ellipse to the current path.

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)

Parameters

x
Single Single Single Single

The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y
Single Single Single Single

The y-coordinate of the upper left corner of the bounding rectangle that defines the ellipse.

width
Single Single Single Single

The width of the bounding rectangle that defines the ellipse.

height
Single Single Single Single

The height of the bounding rectangle that defines the ellipse.

Examples

For an example, see AddEllipse(Rectangle).

Applies to