次の方法で共有


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

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

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

パラメータ

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

戻り値

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

解説

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

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

tension パラメータは、スプラインの形を決定します。 tension パラメータの値が 0.0F の場合、このメソッドは点をつなぐ直線セグメントを描画します。通常、 tension パラメータは 1.0F 以下です。値が 1.0F を超える場合は、予期しない結果になります。

使用例

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

  • 赤いソリッド ブラシを作成します。
  • スプラインを定義する 4 点の配列を作成します。
  • 塗りつぶしモードを FillMode.Winding に設定します。
  • テンションを 1.0 に設定します。
  • 画面の曲線を塗りつぶします。
 
Public Sub FillClosedCurvePointFFillModeTension(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
' Set tension.
Dim tension As Single = 1F
' Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension)
End Sub
        
[C#] 
public void FillClosedCurvePointFFillModeTension(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;
// Set tension.
float tension = 1.0F;
// Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension);
}
        

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