GraphicsPath.AddEllipse Método

Definição

Adiciona uma elipse ao caminho atual.Adds an ellipse to the current path.

Sobrecargas

AddEllipse(Rectangle)

Adiciona uma elipse ao caminho atual.Adds an ellipse to the current path.

AddEllipse(RectangleF)

Adiciona uma elipse ao caminho atual.Adds an ellipse to the current path.

AddEllipse(Int32, Int32, Int32, Int32)

Adiciona uma elipse ao caminho atual.Adds an ellipse to the current path.

AddEllipse(Single, Single, Single, Single)

Adiciona uma elipse ao caminho atual.Adds an ellipse to the current path.

AddEllipse(Rectangle)

Adiciona uma elipse ao caminho atual.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)

Parâmetros

rect
Rectangle

Um Rectangle que representa o retângulo delimitador que define a elipse.A Rectangle that represents the bounding rectangle that defines the ellipse.

Exemplos

O exemplo de código a seguir foi projetado para uso com Windows Forms, e ele requer PaintEventArgs e um OnPaint objeto de evento.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, an OnPaint event object. O código executa as seguintes ações:The code performs the following actions:

Cria um retângulo delimitador que define uma elipse.Creates a bounding rectangle that defines an ellipse.

Cria um caminho e adiciona a elipse ao caminho.Creates a path and adds the ellipse to the path.

Desenha o caminho para a tela.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

Aplica-se a

AddEllipse(RectangleF)

Adiciona uma elipse ao caminho atual.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)

Parâmetros

rect
RectangleF

Um RectangleF que representa o retângulo delimitador que define a elipse.A RectangleF that represents the bounding rectangle that defines the ellipse.

Exemplos

Para ver um exemplo, consulte AddEllipse(Rectangle).For an example, see AddEllipse(Rectangle).

Aplica-se a

AddEllipse(Int32, Int32, Int32, Int32)

Adiciona uma elipse ao caminho atual.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)

Parâmetros

x
Int32

A coordenada X do canto superior esquerdo do retângulo delimitador que define a elipse.The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y
Int32

A coordenada y do canto superior esquerdo do retângulo delimitador que define a elipse.The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

width
Int32

A largura do retângulo delimitador que define a elipse.The width of the bounding rectangle that defines the ellipse.

height
Int32

A altura do retângulo delimitador que define a elipse.The height of the bounding rectangle that defines the ellipse.

Exemplos

Para ver um exemplo, consulte AddEllipse(Rectangle).For an example, see AddEllipse(Rectangle).

Aplica-se a

AddEllipse(Single, Single, Single, Single)

Adiciona uma elipse ao caminho atual.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)

Parâmetros

x
Single

A coordenada X do canto superior esquerdo do retângulo delimitador que define a elipse.The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.

y
Single

A coordenada y do canto superior esquerdo do retângulo delimitador que define a elipse.The y-coordinate of the upper left corner of the bounding rectangle that defines the ellipse.

width
Single

A largura do retângulo delimitador que define a elipse.The width of the bounding rectangle that defines the ellipse.

height
Single

A altura do retângulo delimitador que define a elipse.The height of the bounding rectangle that defines the ellipse.

Exemplos

Para ver um exemplo, consulte AddEllipse(Rectangle).For an example, see AddEllipse(Rectangle).

Aplica-se a