Graphics.DrawEllipseとは? わかりやすく解説

Graphics.DrawEllipse メソッド (Pen, Rectangle)

外接する Rectangle 構造体で指定された楕円を描画します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub DrawEllipse ( _
    pen As Pen, _
    rect As Rectangle _
)
Dim instance As Graphics
Dim pen As Pen
Dim rect As Rectangle

instance.DrawEllipse(pen, rect)
public void DrawEllipse (
    Pen pen,
    Rectangle rect
)
public:
void DrawEllipse (
    Pen^ pen, 
    Rectangle rect
)
public void DrawEllipse (
    Pen pen, 
    Rectangle rect
)
public function DrawEllipse (
    pen : Pen, 
    rect : Rectangle
)

パラメータ

pen

楕円の色、幅、およびスタイルを決定する Pen。

rect

楕円の境界を定義する Rectangle 構造体。

例外例外
例外の種類条件

ArgumentNullException

pen が null 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

Public 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
public 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);
}
public:
   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 );
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.DrawEllipse メソッド (Pen, Single, Single, Single, Single)

座標ペア、高さ、および幅で指定された外接する四角形によって定義される楕円を描画します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

例外例外
例外の種類条件

ArgumentNullException

pen が null 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

Public 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
public 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);
}
public:
   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 );
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.DrawEllipse メソッド

座標ペア、高さ、および幅で指定された外接する四角形によって定義される楕円を描画します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
Graphics.DrawEllipse (Pen, Rectangle) 外接する Rectangle 構造体で指定された楕円を描画します。

.NET Compact Framework によってサポートされています。

Graphics.DrawEllipse (Pen, RectangleF) 外接する RectangleF で定義された楕円を描画します。
Graphics.DrawEllipse (Pen, Int32, Int32, Int32, Int32) 座標ペア、高さ、および幅で指定された外接する四角形によって定義される楕円を描画します。

.NET Compact Framework によってサポートされています。

Graphics.DrawEllipse (Pen, Single, Single, Single, Single) 座標ペア、高さ、および幅で指定された外接する四角形によって定義される楕円を描画します。
参照参照

Graphics.DrawEllipse メソッド (Pen, Int32, Int32, Int32, Int32)

座標ペア、高さ、および幅で指定された外接する四角形によって定義される楕円を描画します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

例外例外
例外の種類条件

ArgumentNullException

pen が null 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

Public 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
public 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);
}
public:
   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 );
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.DrawEllipse メソッド (Pen, RectangleF)

外接する RectangleF で定義された楕円を描画します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub DrawEllipse ( _
    pen As Pen, _
    rect As RectangleF _
)
Dim instance As Graphics
Dim pen As Pen
Dim rect As RectangleF

instance.DrawEllipse(pen, rect)
public void DrawEllipse (
    Pen pen,
    RectangleF rect
)
public:
void DrawEllipse (
    Pen^ pen, 
    RectangleF rect
)
public void DrawEllipse (
    Pen pen, 
    RectangleF rect
)
public function DrawEllipse (
    pen : Pen, 
    rect : RectangleF
)

パラメータ

pen

楕円の色、幅、およびスタイルを決定する Pen。

rect

楕円の境界を定義する RectangleF 構造体。

例外例外
例外の種類条件

ArgumentNullException

pen が null 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

Public 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
public 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);
}
public:
   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 );
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「Graphics.DrawEllipse」の関連用語

Graphics.DrawEllipseのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   



Graphics.DrawEllipseのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS