Graphics.DrawEllipse Metoda

Definice

Nakreslí tři tečky definované ohraničujícím obdélníkem určeným dvojicí souřadnic, výškou a šířkou.

Přetížení

DrawEllipse(Pen, Int32, Int32, Int32, Int32)

Nakreslí tři tečky definované ohraničujícím obdélníkem určeným souřadnicemi pro levý horní roh obdélníku, výšku a šířku.

DrawEllipse(Pen, Single, Single, Single, Single)

Nakreslí tři tečky definované ohraničujícím obdélníkem určeným dvojicí souřadnic, výškou a šířkou.

DrawEllipse(Pen, RectangleF)

Nakreslí tři tečky definované ohraničující RectangleF.

DrawEllipse(Pen, Rectangle)

Nakreslí tři tečky určené ohraničující Rectangle strukturou.

DrawEllipse(Pen, Int32, Int32, Int32, Int32)

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs

Nakreslí tři tečky definované ohraničujícím obdélníkem určeným souřadnicemi pro levý horní roh obdélníku, výšku a šířku.

public:
 void DrawEllipse(System::Drawing::Pen ^ pen, int x, int y, int width, int height);
public void DrawEllipse (System.Drawing.Pen pen, int x, int y, int width, int height);
member this.DrawEllipse : System.Drawing.Pen * int * int * int * int -> unit
Public Sub DrawEllipse (pen As Pen, x As Integer, y As Integer, width As Integer, height As Integer)

Parametry

pen
Pen

Pen určuje barvu, šířku a styl tří teček.

x
Int32

Souřadnice x levého horního rohu ohraničujícího obdélníku, který definuje tři tečky.

y
Int32

Souřadnice y levého horního rohu ohraničujícího obdélníku, který definuje tři tečky.

width
Int32

Šířka ohraničujícího obdélníku, který definuje tři tečky.

height
Int32

Výška ohraničujícího obdélníku, který definuje tři tečky.

Výjimky

pen je null.

Příklady

Následující příklad kódu je určen pro použití s model Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny Paint události. Kód provede následující akce:

  • Vytvoří černé pero.

  • Vytvoří pozici a velikost obdélníku pro vazbu se třemi tečky.

  • Nakreslí tři tečky na obrazovku.

private:
   void DrawEllipseInt( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ blackPen = gcnew Pen( Color::Black,3.0f );

      // Create location and size of ellipse.
      int x = 0;
      int y = 0;
      int width = 200;
      int height = 100;

      // Draw ellipse to screen.
      e->Graphics->DrawEllipse( blackPen, x, y, width, height );
   }
private void DrawEllipseInt(PaintEventArgs e)
{
    // Create pen.
    Pen blackPen = new Pen(Color.Black, 3);
             
    // Create location and size of ellipse.
    int x = 0;
    int y = 0;
    int width = 200;
    int height = 100;
             
    // Draw ellipse to screen.
    e.Graphics.DrawEllipse(blackPen, x, y, width, height);
}
Private Sub DrawEllipseInt(ByVal e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New Pen(Color.Black, 3)

    ' Create location and size of ellipse.
    Dim x As Integer = 0
    Dim y As Integer = 0
    Dim width As Integer = 200
    Dim height As Integer = 100

    ' Draw ellipse to screen.
    e.Graphics.DrawEllipse(blackPen, x, y, width, height)
End Sub

Poznámky

Tato metoda nakreslí tři tečky, která je definována ohraničující obdélník, který xje popsán parametry , ywidth, a height .

Platí pro

DrawEllipse(Pen, Single, Single, Single, Single)

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs

Nakreslí tři tečky definované ohraničujícím obdélníkem určeným dvojicí souřadnic, výškou a šířkou.

public:
 void DrawEllipse(System::Drawing::Pen ^ pen, float x, float y, float width, float height);
public void DrawEllipse (System.Drawing.Pen pen, float x, float y, float width, float height);
member this.DrawEllipse : System.Drawing.Pen * single * single * single * single -> unit
Public Sub DrawEllipse (pen As Pen, x As Single, y As Single, width As Single, height As Single)

Parametry

pen
Pen

Pen určuje barvu, šířku a styl tří teček.

x
Single

Souřadnice x levého horního rohu ohraničujícího obdélníku, který definuje tři tečky.

y
Single

Souřadnice y levého horního rohu ohraničujícího obdélníku, který definuje tři tečky.

width
Single

Šířka ohraničujícího obdélníku, který definuje tři tečky.

height
Single

Výška ohraničujícího obdélníku, který definuje tři tečky.

Výjimky

pen je null.

Příklady

Následující příklad kódu je určen pro použití s model Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny Paint události. Kód provede následující akce:

  • Vytvoří černé pero.

  • Vytvoří pozici a velikost obdélníku pro vazbu se třemi tečky.

  • Nakreslí tři tečky na obrazovku.

private:
   void DrawEllipseFloat( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ blackPen = gcnew Pen( Color::Black,3.0f );

      // Create location and size of ellipse.
      float x = 0.0F;
      float y = 0.0F;
      float width = 200.0F;
      float height = 100.0F;

      // Draw ellipse to screen.
      e->Graphics->DrawEllipse( blackPen, x, y, width, height );
   }
private void DrawEllipseFloat(PaintEventArgs e)
{         
    // Create pen.
    Pen blackPen = new Pen(Color.Black, 3);
             
    // Create location and size of ellipse.
    float x = 0.0F;
    float y = 0.0F;
    float width = 200.0F;
    float height = 100.0F;
             
    // Draw ellipse to screen.
    e.Graphics.DrawEllipse(blackPen, x, y, width, height);
}
Private Sub DrawEllipseFloat(ByVal e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New Pen(Color.Black, 3)

    ' Create location and size of ellipse.
    Dim x As Single = 0.0F
    Dim y As Single = 0.0F
    Dim width As Single = 200.0F
    Dim height As Single = 100.0F

    ' Draw ellipse to screen.
    e.Graphics.DrawEllipse(blackPen, x, y, width, height)
End Sub

Poznámky

Tato metoda nakreslí tři tečky, která je definována ohraničující obdélník, který xje popsán parametry , ywidth, a height .

Platí pro

DrawEllipse(Pen, RectangleF)

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs

Nakreslí tři tečky definované ohraničující RectangleF.

public:
 void DrawEllipse(System::Drawing::Pen ^ pen, System::Drawing::RectangleF rect);
public void DrawEllipse (System.Drawing.Pen pen, System.Drawing.RectangleF rect);
member this.DrawEllipse : System.Drawing.Pen * System.Drawing.RectangleF -> unit
Public Sub DrawEllipse (pen As Pen, rect As RectangleF)

Parametry

pen
Pen

Pen určuje barvu, šířku a styl tří teček.

rect
RectangleF

RectangleF definuje hranice tří teček.

Výjimky

pen je null.

Příklady

Následující příklad kódu je určen pro použití s model Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny Paint události. Kód provede následující akce:

  • Vytvoří černé pero.

  • Vytvoří obdélník pro vazbu se třemi tečky.

  • Nakreslí tři tečky na obrazovku.

private:
   void DrawEllipseRectangleF( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ blackPen = gcnew Pen( Color::Black,3.0f );

      // Create rectangle for ellipse.
      RectangleF rect = RectangleF(0.0F,0.0F,200.0F,100.0F);

      // Draw ellipse to screen.
      e->Graphics->DrawEllipse( blackPen, rect );
   }
private void DrawEllipseRectangleF(PaintEventArgs e)
{
    // Create pen.
    Pen blackPen = new Pen(Color.Black, 3);
             
    // Create rectangle for ellipse.
    RectangleF rect = new RectangleF(0.0F, 0.0F, 200.0F, 100.0F);
             
    // Draw ellipse to screen.
    e.Graphics.DrawEllipse(blackPen, rect);
}
Private Sub DrawEllipseRectangleF(ByVal e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New Pen(Color.Black, 3)

    ' Create rectangle for ellipse.
    Dim rect As New RectangleF(0.0F, 0.0F, 200.0F, 100.0F)

    ' Draw ellipse to screen.
    e.Graphics.DrawEllipse(blackPen, rect)
End Sub

Poznámky

Tato metoda nakreslí tři tečky, která je definována ohraničující obdélník určený parametrem rect .

Platí pro

DrawEllipse(Pen, Rectangle)

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs

Nakreslí tři tečky určené ohraničující Rectangle strukturou.

public:
 void DrawEllipse(System::Drawing::Pen ^ pen, System::Drawing::Rectangle rect);
public void DrawEllipse (System.Drawing.Pen pen, System.Drawing.Rectangle rect);
member this.DrawEllipse : System.Drawing.Pen * System.Drawing.Rectangle -> unit
Public Sub DrawEllipse (pen As Pen, rect As Rectangle)

Parametry

pen
Pen

Pen určuje barvu, šířku a styl tří teček.

rect
Rectangle

Rectangle definuje hranice tří teček.

Výjimky

pen je null.

Příklady

Následující příklad kódu je určen pro použití s model Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny Paint události. Kód provede následující akce:

  • Vytvoří černé pero.

  • Vytvoří obdélník pro vazbu se třemi tečky.

  • Nakreslí tři tečky na obrazovku.

private:
   void DrawEllipseRectangle( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ blackPen = gcnew Pen( Color::Black,3.0f );

      // Create rectangle for ellipse.
      Rectangle rect = Rectangle(0,0,200,100);

      // Draw ellipse to screen.
      e->Graphics->DrawEllipse( blackPen, rect );
   }
private void DrawEllipseRectangle(PaintEventArgs e)
{
    // Create pen.
    Pen blackPen = new Pen(Color.Black, 3);
             
    // Create rectangle for ellipse.
    Rectangle rect = new Rectangle(0, 0, 200, 100);
             
    // Draw ellipse to screen.
    e.Graphics.DrawEllipse(blackPen, rect);
}
Private Sub DrawEllipseRectangle(ByVal e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New Pen(Color.Black, 3)

    ' Create rectangle for ellipse.
    Dim rect As New Rectangle(0, 0, 200, 100)

    ' Draw ellipse to screen.
    e.Graphics.DrawEllipse(blackPen, rect)
End Sub

Poznámky

Tato metoda nakreslí tři tečky, která je definována ohraničující obdélník určený parametrem rect .

Platí pro