共用方式為


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 結構數位所定義的封閉基數曲線內部。

public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, cli::array <System::Drawing::Point> ^ points);
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ... cli::array <System::Drawing::Point> ^ points);
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.Point[] points);
public void FillClosedCurve (System.Drawing.Brush brush, params System.Drawing.Point[] points);
member this.FillClosedCurve : System.Drawing.Brush * System.Drawing.Point[] -> unit
Public Sub FillClosedCurve (brush As Brush, points As Point())
Public Sub FillClosedCurve (brush As Brush, ParamArray points As Point())

參數

brush
Brush

決定填滿特性的 Brush

points
Point[]

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

例外狀況

brush null

-或-

points null

範例

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

  • 建立純紅色筆刷。

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

  • 填滿畫面上的曲線。

曲線的默認緊張度為 0.5。

public:
   void FillClosedCurvePoint( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      //Create array of points for curve.
      Point point1 = Point(100,100);
      Point point2 = Point(200,50);
      Point point3 = Point(250,200);
      Point point4 = Point(50,150);
      array<Point>^ points = {point1,point2,point3,point4};

      // Fill curve on screen.
      e->Graphics->FillClosedCurve( redBrush, points );
   }
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);
}
Public Sub FillClosedCurvePoint(ByVal 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}

    ' Fill curve on screen.
    e.Graphics.FillClosedCurve(redBrush, points)
End Sub

備註

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

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

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

適用於

FillClosedCurve(Brush, PointF[])

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

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

public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, cli::array <System::Drawing::PointF> ^ points);
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ... cli::array <System::Drawing::PointF> ^ points);
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.PointF[] points);
public void FillClosedCurve (System.Drawing.Brush brush, params System.Drawing.PointF[] points);
member this.FillClosedCurve : System.Drawing.Brush * System.Drawing.PointF[] -> unit
Public Sub FillClosedCurve (brush As Brush, points As PointF())
Public Sub FillClosedCurve (brush As Brush, ParamArray points As PointF())

參數

brush
Brush

決定填滿特性的 Brush

points
PointF[]

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

例外狀況

brush null

-或-

points null

範例

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

  • 建立純紅色筆刷。

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

  • 填滿畫面上的曲線。

曲線的默認緊張度為 0.5。

public:
   void FillClosedCurvePointF( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      //Create array of points for curve.
      PointF point1 = PointF(100.0F,100.0F);
      PointF point2 = PointF(200.0F,50.0F);
      PointF point3 = PointF(250.0F,200.0F);
      PointF point4 = PointF(50.0F,150.0F);
      array<PointF>^ points = {point1,point2,point3,point4};

      // Fill curve on screen.
      e->Graphics->FillClosedCurve( redBrush, points );
   }
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);
}
Public Sub FillClosedCurvePointF(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim redBrush As New SolidBrush(Color.Red)

    'Create array of points for curve.
    Dim point1 As New PointF(100.0F, 100.0F)
    Dim point2 As New PointF(200.0F, 50.0F)
    Dim point3 As New PointF(250.0F, 200.0F)
    Dim point4 As New PointF(50.0F, 150.0F)
    Dim points As PointF() = {point1, point2, point3, point4}

    ' Fill curve on screen.
    e.Graphics.FillClosedCurve(redBrush, points)
End Sub

備註

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

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

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

適用於

FillClosedCurve(Brush, ReadOnlySpan<Point>)

來源:
Graphics.cs
來源:
Graphics.cs
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::Point> points);
public void FillClosedCurve (System.Drawing.Brush brush, scoped ReadOnlySpan<System.Drawing.Point> points);
member this.FillClosedCurve : System.Drawing.Brush * ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub FillClosedCurve (brush As Brush, points As ReadOnlySpan(Of Point))

參數

brush
Brush

適用於

FillClosedCurve(Brush, ReadOnlySpan<PointF>)

來源:
Graphics.cs
來源:
Graphics.cs
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::PointF> points);
public void FillClosedCurve (System.Drawing.Brush brush, scoped ReadOnlySpan<System.Drawing.PointF> points);
member this.FillClosedCurve : System.Drawing.Brush * ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub FillClosedCurve (brush As Brush, points As ReadOnlySpan(Of PointF))

參數

brush
Brush

適用於

FillClosedCurve(Brush, Point[], FillMode)

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

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

public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, cli::array <System::Drawing::Point> ^ points, System::Drawing::Drawing2D::FillMode fillmode);
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.Point[] points, System.Drawing.Drawing2D.FillMode fillmode);
member this.FillClosedCurve : System.Drawing.Brush * System.Drawing.Point[] * System.Drawing.Drawing2D.FillMode -> unit
Public Sub FillClosedCurve (brush As Brush, points As Point(), fillmode As FillMode)

參數

brush
Brush

決定填滿特性的 Brush

points
Point[]

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

fillmode
FillMode

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

例外狀況

brush null

-或-

points null

範例

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

  • 建立純紅色筆刷。

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

  • 將填滿模式設定為 Winding

  • 填滿畫面上的曲線。

曲線的默認緊張度為 0.5。

public:
   void FillClosedCurvePointFillMode( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      //Create array of points for curve.
      Point point1 = Point(100,100);
      Point point2 = Point(200,50);
      Point point3 = Point(250,200);
      Point point4 = Point(50,150);
      array<Point>^ points = {point1,point2,point3,point4};

      // Set fill mode.
      FillMode newFillMode = FillMode::Winding;

      // Fill curve on screen.
      e->Graphics->FillClosedCurve( redBrush, points, newFillMode );
   }
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);
}
Public Sub FillClosedCurvePointFillMode(ByVal 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

    ' Fill curve on screen.
    e.Graphics.FillClosedCurve(redBrush, points, newFillMode)
End Sub

備註

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

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

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

適用於

FillClosedCurve(Brush, PointF[], FillMode)

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

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

public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, cli::array <System::Drawing::PointF> ^ points, System::Drawing::Drawing2D::FillMode fillmode);
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillmode);
member this.FillClosedCurve : System.Drawing.Brush * System.Drawing.PointF[] * System.Drawing.Drawing2D.FillMode -> unit
Public Sub FillClosedCurve (brush As Brush, points As PointF(), fillmode As FillMode)

參數

brush
Brush

決定填滿特性的 Brush

points
PointF[]

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

fillmode
FillMode

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

例外狀況

brush null

-或-

points null

範例

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

  • 建立純紅色筆刷。

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

  • 將填滿模式設定為 Winding

  • 填滿畫面上的曲線。

曲線的默認緊張度為 0.5。

public:
   void FillClosedCurvePointFFillMode( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      // Create array of points for curve.
      PointF point1 = PointF(100.0F,100.0F);
      PointF point2 = PointF(200.0F,50.0F);
      PointF point3 = PointF(250.0F,200.0F);
      PointF point4 = PointF(50.0F,150.0F);
      array<PointF>^ points = {point1,point2,point3,point4};

      // Set fill mode.
      FillMode newFillMode = FillMode::Winding;

      // Fill curve on screen.
      e->Graphics->FillClosedCurve( redBrush, points, newFillMode );
   }
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);
}
Public Sub FillClosedCurvePointFFillMode(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim redBrush As New SolidBrush(Color.Red)

    ' Create array of points for curve.
    Dim point1 As New PointF(100.0F, 100.0F)
    Dim point2 As New PointF(200.0F, 50.0F)
    Dim point3 As New PointF(250.0F, 200.0F)
    Dim point4 As New PointF(50.0F, 150.0F)
    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

備註

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

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

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

適用於

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode)

來源:
Graphics.cs
來源:
Graphics.cs
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::Point> points, System::Drawing::Drawing2D::FillMode fillmode);
public void FillClosedCurve (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.Point> points, System.Drawing.Drawing2D.FillMode fillmode);
member this.FillClosedCurve : System.Drawing.Brush * ReadOnlySpan<System.Drawing.Point> * System.Drawing.Drawing2D.FillMode -> unit
Public Sub FillClosedCurve (brush As Brush, points As ReadOnlySpan(Of Point), fillmode As FillMode)

參數

brush
Brush
fillmode
FillMode

適用於

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode)

來源:
Graphics.cs
來源:
Graphics.cs
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::PointF> points, System::Drawing::Drawing2D::FillMode fillmode);
public void FillClosedCurve (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.PointF> points, System.Drawing.Drawing2D.FillMode fillmode);
member this.FillClosedCurve : System.Drawing.Brush * ReadOnlySpan<System.Drawing.PointF> * System.Drawing.Drawing2D.FillMode -> unit
Public Sub FillClosedCurve (brush As Brush, points As ReadOnlySpan(Of PointF), fillmode As FillMode)

參數

brush
Brush
fillmode
FillMode

適用於

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

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

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

public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, cli::array <System::Drawing::Point> ^ points, System::Drawing::Drawing2D::FillMode fillmode, float tension);
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.Point[] points, System.Drawing.Drawing2D.FillMode fillmode, float tension);
member this.FillClosedCurve : System.Drawing.Brush * System.Drawing.Point[] * System.Drawing.Drawing2D.FillMode * single -> unit
Public Sub FillClosedCurve (brush As Brush, points As Point(), fillmode As FillMode, tension As Single)

參數

brush
Brush

決定填滿特性的 Brush

points
Point[]

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

fillmode
FillMode

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

tension
Single

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

例外狀況

brush null

-或-

points null

範例

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

  • 建立純紅色筆刷。

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

  • 將填滿模式設定為 Winding

  • 將緊張設定為 1.0。

  • 填滿畫面上的曲線。

public:
   void FillClosedCurvePointFillModeTension( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      // Create array of points for curve.
      Point point1 = Point(100,100);
      Point point2 = Point(200,50);
      Point point3 = Point(250,200);
      Point point4 = Point(50,150);
      array<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 );
   }
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);
}
Public Sub FillClosedCurvePointFillModeTension(ByVal 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 = 1.0F

    ' Fill curve on screen.
    e.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension)
End Sub

備註

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

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

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

適用於

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

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

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

public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, cli::array <System::Drawing::PointF> ^ points, System::Drawing::Drawing2D::FillMode fillmode, float tension);
public void FillClosedCurve (System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillmode, float tension);
member this.FillClosedCurve : System.Drawing.Brush * System.Drawing.PointF[] * System.Drawing.Drawing2D.FillMode * single -> unit
Public Sub FillClosedCurve (brush As Brush, points As PointF(), fillmode As FillMode, tension As Single)

參數

brush
Brush

決定填滿特性的 Brush

points
PointF[]

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

fillmode
FillMode

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

tension
Single

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

例外狀況

brush null

-或-

points null

範例

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

  • 建立純紅色筆刷。

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

  • 將填滿模式設定為 Winding

  • 將緊張設定為 1.0。

  • 填滿畫面上的曲線。

public:
   void FillClosedCurvePointFFillModeTension( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );

      // Create array of points for curve.
      PointF point1 = PointF(100.0F,100.0F);
      PointF point2 = PointF(200.0F,50.0F);
      PointF point3 = PointF(250.0F,200.0F);
      PointF point4 = PointF(50.0F,150.0F);
      array<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 );
   }
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);
}
Public Sub FillClosedCurvePointFFillModeTension(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim redBrush As New SolidBrush(Color.Red)

    ' Create array of points for curve.
    Dim point1 As New PointF(100.0F, 100.0F)
    Dim point2 As New PointF(200.0F, 50.0F)
    Dim point3 As New PointF(250.0F, 200.0F)
    Dim point4 As New PointF(50.0F, 150.0F)
    Dim points As PointF() = {point1, point2, point3, point4}

    ' Set fill mode.
    Dim newFillMode As FillMode = FillMode.Winding

    ' Set tension.
    Dim tension As Single = 1.0F

    ' Fill curve on screen.
    e.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension)
End Sub

備註

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

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

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

適用於

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

來源:
Graphics.cs
來源:
Graphics.cs
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::Point> points, System::Drawing::Drawing2D::FillMode fillmode, float tension);
public void FillClosedCurve (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.Point> points, System.Drawing.Drawing2D.FillMode fillmode, float tension);
member this.FillClosedCurve : System.Drawing.Brush * ReadOnlySpan<System.Drawing.Point> * System.Drawing.Drawing2D.FillMode * single -> unit
Public Sub FillClosedCurve (brush As Brush, points As ReadOnlySpan(Of Point), fillmode As FillMode, tension As Single)

參數

brush
Brush
fillmode
FillMode
tension
Single

適用於

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

來源:
Graphics.cs
來源:
Graphics.cs
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::PointF> points, System::Drawing::Drawing2D::FillMode fillmode, float tension);
public void FillClosedCurve (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.PointF> points, System.Drawing.Drawing2D.FillMode fillmode, float tension);
member this.FillClosedCurve : System.Drawing.Brush * ReadOnlySpan<System.Drawing.PointF> * System.Drawing.Drawing2D.FillMode * single -> unit
Public Sub FillClosedCurve (brush As Brush, points As ReadOnlySpan(Of PointF), fillmode As FillMode, tension As Single)

參數

brush
Brush
fillmode
FillMode
tension
Single

適用於