外接する Rectangle 構造体で指定された楕円を描画します。
Overloads Public Sub DrawEllipse( _
ByVal pen As Pen, _ ByVal rect As Rectangle _)
[C#]
public void DrawEllipse(Penpen,Rectanglerect);
[C++]
public: void DrawEllipse(Pen* pen,Rectanglerect);
[JScript]
public function DrawEllipse(
pen : Pen,rect : Rectangle);
パラメータ
戻り値
このメソッドは値を返しません。
解説
このメソッドは、 rect パラメータで指定された外接する四角形によって定義される楕円を描画します。
使用例
[Visual Basic, C#] 次の例は、Windows フォームでの使用を意図してデザインされており、 Paint イベント ハンドラのパラメータである PaintEventArgs e が必要です。このコードは次のアクションを実行します。
- 黒いペンを作成します。
- 楕円に外接する四角形を作成します。
- 画面に楕円を描画します。
Public Sub DrawEllipseRectangle(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
[C#]
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);
}
[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン
をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET
参照
Graphics クラス | Graphics メンバ | System.Drawing 名前空間 | Graphics.DrawEllipse オーバーロードの一覧