次の方法で共有


Graphics.FillClosedCurve メソッド (Brush, PointF , FillMode)

PointF 構造体の配列で定義される、閉じたカーディナル スプライン曲線の内部を指定の塗りつぶしモードで塗りつぶします。

Overloads Public Sub FillClosedCurve( _
   ByVal brush As Brush, _   ByVal points() As PointF, _   ByVal fillmode As FillMode _)
[C#]
public void FillClosedCurve(Brushbrush,PointF[] points,FillModefillmode);
[C++]
public: void FillClosedCurve(Brush* brush,PointFpoints[],FillModefillmode);
[JScript]
public function FillClosedCurve(
   brush : Brush,points : PointF[],fillmode : FillMode);

パラメータ

  • brush
    塗りつぶしの特性を決定する Brush オブジェクト。
  • points
    スプラインを定義する PointF 構造体の配列。
  • fillmode
    曲線を塗りつぶす方法を決定する FillMode 列挙体のメンバ。

戻り値

このメソッドは値を返しません。

解説

このメソッドは、配列の各点を通過する閉じたカーディナル スプラインの内部を塗りつぶします。最後の点と最初の点が一致しない場合は、曲線を閉じるために最後の点と最初の点を結ぶ曲線の線分が追加されます。

点の配列には、4 つ以上の Point 構造体を含める必要があります。

このメソッドは既定のテンションである 0.5 を使用します。

使用例

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

  • 赤いソリッド ブラシを作成します。
  • スプラインを定義する 4 点の配列を作成します。
  • 塗りつぶしモードを FillMode.Winding に設定します。
  • 画面の曲線を塗りつぶします。

[Visual Basic, C#] この曲線の既定のテンションは 0.5 です。

 
Public Sub FillClosedCurvePointFFillMode(e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create array of points for curve.
Dim point1 As New PointF(100F, 100F)
Dim point2 As New PointF(200F, 50F)
Dim point3 As New PointF(250F, 200F)
Dim point4 As New PointF(50F, 150F)
Dim points As PointF() =  {point1, point2, point3, point4}
' Set fill mode.
Dim newFillMode As FillMode = FillMode.Winding
' Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points, newFillMode)
End Sub
        
[C#] 
public void FillClosedCurvePointFFillMode(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create array of points for curve.
PointF point1 = new PointF(100.0F, 100.0F);
PointF point2 = new PointF(200.0F,  50.0F);
PointF point3 = new PointF(250.0F, 200.0F);
PointF point4 = new PointF( 50.0F, 150.0F);
PointF[] points = {point1, point2, point3, point4};
// Set fill mode.
FillMode newFillMode = FillMode.Winding;
// Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points, newFillMode);
}
        

[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.FillClosedCurve オーバーロードの一覧