座標ペア、幅、および高さで指定された楕円と 2 本の半径によって定義される扇形の内部を塗りつぶします。
Overloads Public Sub FillPie( _
ByVal brush As Brush, _ ByVal x As Integer, _ ByVal y As Integer, _ ByVal width As Integer, _ ByVal height As Integer, _ ByVal startAngle As Integer, _ ByVal sweepAngle As Integer _)
[C#]
public void FillPie(Brushbrush,intx,inty,intwidth,intheight,intstartAngle,intsweepAngle);
[C++]
public: void FillPie(Brush* brush,intx,inty,intwidth,intheight,intstartAngle,intsweepAngle);
[JScript]
public function FillPie(
brush : Brush,x : int,y : int,width : int,height : int,startAngle : int,sweepAngle : int);
パラメータ
- brush
塗りつぶしの特性を決定する Brush オブジェクト。 - x
扇形の元となる楕円を定義する外接する四角形の左上隅の x 座標。 - y
扇形の元となる楕円を定義する外接する四角形の左上隅の y 座標。 - width
扇形の元となる楕円を定義する外接する四角形の幅。 - height
扇形の元となる楕円を定義する外接する四角形の高さ。 - startAngle
x 軸から扇形の最初の辺まで、時計回りに測定した角度 (度単位)。 - sweepAngle
startAngle パラメータから扇形の 2 番目の辺まで、時計回りに測定した角度 (度単位)。
戻り値
このメソッドは値を返しません。
解説
このメソッドは、楕円の円弧と、その円弧の終了点と交差する 2 本の半径で定義された扇形の内部を塗りつぶします。楕円は、外接する四角形によって定義されます。扇形は、 startAngle パラメータと sweepAngle パラメータで定義される 2 本の半径と、これらの半径と楕円の交差部分の間にある円弧から構成されます。
sweepAngle パラメータが 360 度よりも大きいか、-360 度よりも小さい場合は、それぞれ 360 度または -360 度として処理されます。
使用例
[Visual Basic, C#] 次の例は、Windows フォームでの使用を意図してデザインされており、 Paint イベント ハンドラのパラメータである PaintEventArgs e が必要です。このコードは次のアクションを実行します。
- 赤いソリッド ブラシを作成します。
- 楕円に外接する四角形の位置とサイズを作成します。
- x 軸に対して相対的な開始角度と、スイープ角度を定義します (どちらも時計回り方向に測定)。
- 画面の楕円の扇形領域を塗りつぶします。
Public Sub FillPieInt(e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' 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
' Create start and sweep angles.
Dim startAngle As Integer = 0
Dim sweepAngle As Integer = 45
' Fill pie to screen.
e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, _
sweepAngle)
End Sub
[C#]
public void FillPieInt(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create ___location and size of ellipse.
int x = 0;
int y = 0;
int width = 200;
int height = 100;
// Create start and sweep angles.
int startAngle = 0;
int sweepAngle = 45;
// Fill pie to screen.
e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, sweepAngle);
}
[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 ファミリ
参照
Graphics クラス | Graphics メンバ | System.Drawing 名前空間 | Graphics.FillPie オーバーロードの一覧