Graphics.FillClosedCurve 方法

定義

填滿由 Point 結構數位所定義的封閉基數曲線內部。

多載

FillClosedCurve(Brush, Point[])

填滿由 Point 結構數位所定義的封閉基數曲線內部。

FillClosedCurve(Brush, PointF[])

填滿由 PointF 結構數位所定義的封閉基數曲線內部。

FillClosedCurve(Brush, ReadOnlySpan<Point>)
FillClosedCurve(Brush, ReadOnlySpan<PointF>)
FillClosedCurve(Brush, Point[], FillMode)

使用指定的填滿模式,填滿由 Point 結構陣列所定義的封閉基數曲線內部。

FillClosedCurve(Brush, PointF[], FillMode)

使用指定的填滿模式,填滿由 PointF 結構陣列所定義的封閉基數曲線內部。

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode)
FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode)
FillClosedCurve(Brush, Point[], FillMode, Single)

使用指定的填滿模式和緊張,填滿由 Point 結構陣列所定義的封閉基數曲線內部。

FillClosedCurve(Brush, PointF[], FillMode, Single)

使用指定的填滿模式和緊張,填滿由 PointF 結構陣列所定義的封閉基數曲線內部。

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode, Single)
FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode, Single)

FillClosedCurve(Brush, Point[])

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

填滿由 Point 結構數位所定義的封閉基數曲線內部。

C#
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.Point[] points);
C#
public void FillClosedCurve (System.Drawing.Brush brush, params System.Drawing.Point[] points);

參數

brush
Brush

決定填滿特性的 Brush

points
Point[]

定義曲線之 Point 結構的數位。

例外狀況

brush null

-或-

points null

範例

下列程式代碼範例是專為搭配 Windows Forms 使用而設計,而且需要 PaintEventArgse,這是 Paint 事件處理程式的參數。 程式代碼會執行下列動作:

  • 建立純紅色筆刷。

  • 建立四個點的陣列,以定義曲線。

  • 填滿畫面上的曲線。

曲線的默認緊張度為 0.5。

C#
public void FillClosedCurvePoint(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};
             
    // Fill curve on screen.
    e.Graphics.FillClosedCurve(redBrush, points);
}

備註

這個方法會填入封閉基數曲線的內部,該曲線會通過數位中的每個點。 如果最後一個點不符合第一個點,則會從最後一個點新增到第一個點以關閉它的額外曲線線段。

點陣陣必須至少包含四個 Point 結構。

此方法使用預設的緊張度 0.5。

適用於

.NET 9 和其他版本
產品 版本
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

FillClosedCurve(Brush, PointF[])

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

填滿由 PointF 結構數位所定義的封閉基數曲線內部。

C#
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.PointF[] points);
C#
public void FillClosedCurve (System.Drawing.Brush brush, params System.Drawing.PointF[] points);

參數

brush
Brush

決定填滿特性的 Brush

points
PointF[]

定義曲線之 PointF 結構的數位。

例外狀況

brush null

-或-

points null

範例

下列程式代碼範例是專為搭配 Windows Forms 使用而設計,而且需要 PaintEventArgse,這是 Paint 事件處理程式的參數。 程式代碼會執行下列動作:

  • 建立純紅色筆刷。

  • 建立四個點的陣列,以定義曲線。

  • 填滿畫面上的曲線。

曲線的默認緊張度為 0.5。

C#
public void FillClosedCurvePointF(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};
             
    // Fill curve on screen.
    e.Graphics.FillClosedCurve(redBrush, points);
}

備註

這個方法會填入封閉基數曲線的內部,該曲線會通過數位中的每個點。 如果最後一個點不符合第一個點,則會從最後一個點新增到第一個點以關閉它的額外曲線線段。

點陣陣必須至少包含四個 PointF 結構。

此方法使用預設的緊張度 0.5。

適用於

.NET 9 和其他版本
產品 版本
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

FillClosedCurve(Brush, ReadOnlySpan<Point>)

來源:
Graphics.cs
來源:
Graphics.cs
C#
public void FillClosedCurve (System.Drawing.Brush brush, scoped ReadOnlySpan<System.Drawing.Point> points);

參數

brush
Brush

適用於

.NET 9 和 Windows Desktop 9
產品 版本
.NET 9
Windows Desktop 9

FillClosedCurve(Brush, ReadOnlySpan<PointF>)

來源:
Graphics.cs
來源:
Graphics.cs
C#
public void FillClosedCurve (System.Drawing.Brush brush, scoped ReadOnlySpan<System.Drawing.PointF> points);

參數

brush
Brush

適用於

.NET 9 和 Windows Desktop 9
產品 版本
.NET 9
Windows Desktop 9

FillClosedCurve(Brush, Point[], FillMode)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

使用指定的填滿模式,填滿由 Point 結構陣列所定義的封閉基數曲線內部。

C#
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.Point[] points, System.Drawing.Drawing2D.FillMode fillmode);

參數

brush
Brush

決定填滿特性的 Brush

points
Point[]

定義曲線之 Point 結構的數位。

fillmode
FillMode

決定曲線填滿方式之 FillMode 列舉的成員。

例外狀況

brush null

-或-

points null

範例

下列程式代碼範例是專為搭配 Windows Forms 使用而設計,而且需要 PaintEventArgse,這是 Paint 事件處理程式的參數。 程式代碼會執行下列動作:

  • 建立純紅色筆刷。

  • 建立四個點的陣列,以定義曲線。

  • 將填滿模式設定為 Winding

  • 填滿畫面上的曲線。

曲線的默認緊張度為 0.5。

C#
public void FillClosedCurvePointFillMode(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;
             
    // Fill curve on screen.
    e.Graphics.FillClosedCurve(redBrush, points, newFillMode);
}

備註

這個方法會填入封閉基數曲線的內部,該曲線會通過數位中的每個點。 如果最後一個點不符合第一個點,則會從最後一個點新增到第一個點以關閉它的額外曲線線段。

點陣陣必須至少包含四個 Point 結構。

此方法使用預設的緊張度 0.5。

適用於

.NET 9 和其他版本
產品 版本
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

FillClosedCurve(Brush, PointF[], FillMode)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

使用指定的填滿模式,填滿由 PointF 結構陣列所定義的封閉基數曲線內部。

C#
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillmode);

參數

brush
Brush

決定填滿特性的 Brush

points
PointF[]

定義曲線之 PointF 結構的數位。

fillmode
FillMode

決定曲線填滿方式之 FillMode 列舉的成員。

例外狀況

brush null

-或-

points null

範例

下列程式代碼範例是專為搭配 Windows Forms 使用而設計,而且需要 PaintEventArgse,這是 Paint 事件處理程式的參數。 程式代碼會執行下列動作:

  • 建立純紅色筆刷。

  • 建立四個點的陣列,以定義曲線。

  • 將填滿模式設定為 Winding

  • 填滿畫面上的曲線。

曲線的默認緊張度為 0.5。

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);
}

備註

這個方法會填入封閉基數曲線的內部,該曲線會通過數位中的每個點。 如果最後一個點不符合第一個點,則會從最後一個點新增到第一個點以關閉它的額外曲線線段。

點陣陣必須至少包含四個 Point 結構。

此方法使用預設的緊張度 0.5。

適用於

.NET 9 和其他版本
產品 版本
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode)

來源:
Graphics.cs
來源:
Graphics.cs
C#
public void FillClosedCurve (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.Point> points, System.Drawing.Drawing2D.FillMode fillmode);

參數

brush
Brush
fillmode
FillMode

適用於

.NET 9 和 Windows Desktop 9
產品 版本
.NET 9
Windows Desktop 9

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode)

來源:
Graphics.cs
來源:
Graphics.cs
C#
public void FillClosedCurve (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.PointF> points, System.Drawing.Drawing2D.FillMode fillmode);

參數

brush
Brush
fillmode
FillMode

適用於

.NET 9 和 Windows Desktop 9
產品 版本
.NET 9
Windows Desktop 9

FillClosedCurve(Brush, Point[], FillMode, Single)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

使用指定的填滿模式和緊張,填滿由 Point 結構陣列所定義的封閉基數曲線內部。

C#
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.Point[] points, System.Drawing.Drawing2D.FillMode fillmode, float tension);

參數

brush
Brush

決定填滿特性的 Brush

points
Point[]

定義曲線之 Point 結構的數位。

fillmode
FillMode

決定曲線填滿方式之 FillMode 列舉的成員。

tension
Single

大於或等於 0.0F 的值,指定曲線的緊張度。

例外狀況

brush null

-或-

points null

範例

下列程式代碼範例是專為搭配 Windows Forms 使用而設計,而且需要 PaintEventArgse,這是 Paint 事件處理程式的參數。 程式代碼會執行下列動作:

  • 建立純紅色筆刷。

  • 建立四個點的陣列,以定義曲線。

  • 將填滿模式設定為 Winding

  • 將緊張設定為 1.0。

  • 填滿畫面上的曲線。

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);
}

備註

這個方法會填入封閉基數曲線的內部,該曲線會通過數位中的每個點。 如果最後一個點不符合第一個點,則會從最後一個點新增到第一個點以關閉它的額外曲線線段。

點陣陣必須至少包含四個 Point 結構。

tension 參數會決定曲線的形狀。 如果 tension 參數的值是 0.0F,這個方法會繪製直線線段來連接點。 通常,tension 參數小於或等於1.0F。 超過 1.0F 的值會產生不尋常的結果。

適用於

.NET 9 和其他版本
產品 版本
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

FillClosedCurve(Brush, PointF[], FillMode, Single)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

使用指定的填滿模式和緊張,填滿由 PointF 結構陣列所定義的封閉基數曲線內部。

C#
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillmode, float tension);

參數

brush
Brush

決定填滿特性的 Brush

points
PointF[]

定義曲線之 PointF 結構的數位。

fillmode
FillMode

決定曲線填滿方式之 FillMode 列舉的成員。

tension
Single

大於或等於 0.0F 的值,指定曲線的緊張度。

例外狀況

brush null

-或-

points null

範例

下列程式代碼範例是專為搭配 Windows Forms 使用而設計,而且需要 PaintEventArgse,這是 Paint 事件處理程式的參數。 程式代碼會執行下列動作:

  • 建立純紅色筆刷。

  • 建立四個點的陣列,以定義曲線。

  • 將填滿模式設定為 Winding

  • 將緊張設定為 1.0。

  • 填滿畫面上的曲線。

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);
}

備註

這個方法會填入封閉基數曲線的內部,該曲線會通過數位中的每個點。 如果最後一個點不符合第一個點,則會從最後一個點新增到第一個點以關閉它的額外曲線線段。

點陣陣必須至少包含四個 Point 結構。

tension 參數會決定曲線的形狀。 如果 tension 參數的值是 0.0F,這個方法會繪製直線線段來連接點。 通常,tension 參數小於或等於1.0F。 超過 1.0F 的值會產生不尋常的結果。

適用於

.NET 9 和其他版本
產品 版本
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode, Single)

來源:
Graphics.cs
來源:
Graphics.cs
C#
public void FillClosedCurve (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.Point> points, System.Drawing.Drawing2D.FillMode fillmode, float tension);

參數

brush
Brush
fillmode
FillMode
tension
Single

適用於

.NET 9 和 Windows Desktop 9
產品 版本
.NET 9
Windows Desktop 9

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode, Single)

來源:
Graphics.cs
來源:
Graphics.cs
C#
public void FillClosedCurve (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.PointF> points, System.Drawing.Drawing2D.FillMode fillmode, float tension);

參數

brush
Brush
fillmode
FillMode
tension
Single

適用於

.NET 9 和 Windows Desktop 9
產品 版本
.NET 9
Windows Desktop 9