語言

Graphics.FillClosedCurve 方法

定義

填充由一組 Point 結構陣列定義的封閉基數樣條曲線的內部。

多載

名稱 Description
FillClosedCurve(Brush, Point[])

填充由一組 Point 結構陣列定義的封閉基數樣條曲線的內部。

FillClosedCurve(Brush, PointF[])

填充由一組 PointF 結構陣列定義的封閉基數樣條曲線的內部。

FillClosedCurve(Brush, ReadOnlySpan<Point>)

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

FillClosedCurve(Brush, ReadOnlySpan<PointF>)

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

FillClosedCurve(Brush, Point[], FillMode)

填充由一組 Point 結構組成的封閉基數樣條曲線內部,並使用指定的填充模式。

FillClosedCurve(Brush, PointF[], FillMode)

填充由一組 PointF 結構組成的封閉基數樣條曲線內部,並使用指定的填充模式。

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode)

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode)

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

填充由一系列結構組成 Point 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

FillClosedCurve(Brush, Point[])

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
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, params System.Drawing.Point[] points);
public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.Point[] points);
member this.FillClosedCurve : System.Drawing.Brush * System.Drawing.Point[] -> unit
Public Sub FillClosedCurve (brush As Brush, ParamArray points As Point())
Public Sub FillClosedCurve (brush As Brush, 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
來源:
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, params System.Drawing.PointF[] points);
public void FillClosedCurve(System.Drawing.Brush brush, System.Drawing.PointF[] points);
member this.FillClosedCurve : System.Drawing.Brush * System.Drawing.PointF[] -> unit
Public Sub FillClosedCurve (brush As Brush, ParamArray points As PointF())
Public Sub FillClosedCurve (brush As Brush, 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
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

Brush A,決定填料的特性。

points
ReadOnlySpan<Point>

定義樣條的結構陣列 PointF 。

適用於

FillClosedCurve(Brush, ReadOnlySpan<PointF>)

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

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

Brush A,決定填料的特性。

points
ReadOnlySpan<PointF>

定義樣條的結構陣列 PointF 。

適用於

FillClosedCurve(Brush, Point[], FillMode)

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
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
來源:
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
來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

Brush A,決定填料的特性。

points
ReadOnlySpan<Point>

定義樣條的結構陣列 PointF 。

fillmode
FillMode

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

適用於

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode)

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

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

Brush A,決定填料的特性。

points
ReadOnlySpan<PointF>

定義樣條的結構陣列 PointF 。

fillmode
FillMode

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

適用於

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

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
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.0華氏度的數值會產生異常結果。

適用於

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

來源:
Graphics.cs
來源:
Graphics.cs
來源:
Graphics.cs
來源:
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 A,決定填料的特性。

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.0華氏度的數值會產生異常結果。

適用於

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

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

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

Brush A,決定填料的特性。

points
ReadOnlySpan<Point>

定義樣條的結構陣列 PointF 。

fillmode
FillMode

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

tension
Single

值大於或等於0.0F,表示曲線張力。

適用於

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

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

填充由一系列結構組成 PointF 的封閉基數樣條曲線內部,使用指定的填充模式與張力。

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

Brush A,決定填料的特性。

points
ReadOnlySpan<PointF>

定義樣條的結構陣列 PointF 。

fillmode
FillMode

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

tension
Single

值大於或等於0.0F,表示曲線張力。

適用於