Graphics.FillPie メソッド
座標ペア、幅、および高さで指定された楕円と 2 本の半径によって定義される扇形の内部を塗りつぶします。
オーバーロードの一覧
RectangleF 構造体と 2 本の半径によって指定された楕円で定義される扇形の内部を塗りつぶします。
[Visual Basic] Overloads Public Sub FillPie(Brush, Rectangle, Single, Single)
[C++] public: void FillPie(Brush*, Rectangle, float, float);
[JScript] public function FillPie(Brush, Rectangle, float, float);
座標ペア、幅、および高さで指定された楕円と 2 本の半径によって定義される扇形の内部を塗りつぶします。
[Visual Basic] Overloads Public Sub FillPie(Brush, Integer, Integer, Integer, Integer, Integer, Integer)
[C#] public void FillPie(Brush, int, int, int, int, int, int);
[C++] public: void FillPie(Brush*, int, int, int, int, int, int);
[JScript] public function FillPie(Brush, int, int, int, int, int, int);
座標ペア、幅、および高さで指定された楕円と 2 本の半径によって定義される扇形の内部を塗りつぶします。
[Visual Basic] Overloads Public Sub FillPie(Brush, Single, Single, Single, Single, Single, Single)
[C#] public void FillPie(Brush, float, float, float, float, float, float);
[C++] public: void FillPie(Brush*, float, float, float, float, float, float);
[JScript] public function FillPie(Brush, float, float, float, float, float, float);
使用例
[Visual Basic, C#] 次の例は、Windows フォームでの使用を意図してデザインされており、 Paint イベント ハンドラのパラメータである PaintEventArgs e が必要です。このコードは次のアクションを実行します。
- 赤いソリッド ブラシを作成します。
- 楕円に外接する四角形の位置とサイズを作成します。
- x 軸に対して相対的な開始角度と、スイープ角度を定義します (どちらも時計回り方向に測定)。
- 画面の楕円の扇形領域を塗りつぶします。
[Visual Basic, C#] メモ ここでは、FillPie のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。
Public Sub FillPieFloat(e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create location and size of ellipse.
Dim x As Single = 0F
Dim y As Single = 0F
Dim width As Single = 200F
Dim height As Single = 100F
' Create start and sweep angles.
Dim startAngle As Single = 0F
Dim sweepAngle As Single = 45F
' Fill pie to screen.
e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, _
sweepAngle)
End Sub
[C#]
public void FillPieFloat(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create location and size of ellipse.
float x = 0.0F;
float y = 0.0F;
float width = 200.0F;
float height = 100.0F;
// Create start and sweep angles.
float startAngle = 0.0F;
float sweepAngle = 45.0F;
// Fill pie to screen.
e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, sweepAngle);
}
[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。