Point 構造体の配列で定義される、閉じたカーディナル スプライン曲線の内部を指定の塗りつぶしモードおよびテンションで塗りつぶします。
Overloads Public Sub FillClosedCurve( _
ByVal brush As Brush, _ ByVal points() As Point, _ ByVal fillmode As FillMode, _ ByVal tension As Single _)
[C#]
public void FillClosedCurve(Brushbrush,Point[] points,FillModefillmode,floattension);
[C++]
public: void FillClosedCurve(Brush* brush,Pointpoints[],FillModefillmode,floattension);
[JScript]
public function FillClosedCurve(
brush : Brush,points : Point[],fillmode : FillMode,tension : float);
パラメータ
- brush
塗りつぶしの特性を決定する Brush オブジェクト。 - points
スプラインを定義する Point 構造体の配列。 - 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 FillClosedCurvePointFillModeTension(e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create array of points for curve.
Dim point1 As New Point(100, 100)
Dim point2 As New Point(200, 50)
Dim point3 As New Point(250, 200)
Dim point4 As New Point(50, 150)
Dim points As Point() = {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 FillClosedCurvePointFillModeTension(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create array of points for curve.
Point point1 = new Point(100, 100);
Point point2 = new Point(200, 50);
Point point3 = new Point(250, 200);
Point point4 = new Point( 50, 150);
Point[] 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 オーバーロードの一覧