Graphics.FillClosedCurve 方法

定义

填充由 Point 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of Point structures.

重载

FillClosedCurve(Brush, Point[])

填充由 Point 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of Point structures.

FillClosedCurve(Brush, PointF[])

填充由 PointF 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of PointF structures.

FillClosedCurve(Brush, Point[], FillMode)

使用指定的填充模式填充 Point 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of Point structures using the specified fill mode.

FillClosedCurve(Brush, PointF[], FillMode)

使用指定的填充模式填充 PointF 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of PointF structures using the specified fill mode.

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

使用指定的填充模式和张力填充 Point 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of Point structures using the specified fill mode and tension.

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

使用指定的填充模式和张力填充 PointF 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of PointF structures using the specified fill mode and tension.

FillClosedCurve(Brush, Point[])

填充由 Point 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of Point structures.

public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, cli::array <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, points As Point())

参数

brush
Brush

确定填充特性的 BrushBrush that determines the characteristics of the fill.

points
Point[]

Point 结构数组,这些结构定义样条。Array of Point structures that define the spline.

例外

brushnullbrush is null.

- 或 --or- pointsnullpoints is null.

示例

下面的代码示例旨在与 Windows 窗体一起使用,并且它需要作为 PaintEventArgs e Paint 事件处理程序的参数。The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 此代码执行以下操作:The code performs the following actions:

  • 创建一个纯红色画笔。Creates a solid red brush.

  • 创建一个由四个点组成的数组,用于定义样条。Creates an array of four points to define a spline.

  • 填充屏幕上的曲线。Fills the curve on the screen.

曲线的默认张力为0.5。The curve has a default tension of 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

注解

此方法填充经过数组中每个点的闭合基数样条的内部。This method fills the interior of a closed cardinal spline that passes through each point in the array. 如果最后一个点与第一个点不匹配,则从最后一个点向第一个点添加一个曲线段,以将其关闭。If the last point does not match the first point, an additional curve segment is added from the last point to the first point to close it.

点数组必须至少包含四个 Point 结构。The array of points must contain at least four Point structures.

此方法使用默认张力0.5。This method uses a default tension of 0.5.

适用于

FillClosedCurve(Brush, PointF[])

填充由 PointF 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of PointF structures.

public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, cli::array <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, points As PointF())

参数

brush
Brush

确定填充特性的 BrushBrush that determines the characteristics of the fill.

points
PointF[]

PointF 结构数组,这些结构定义样条。Array of PointF structures that define the spline.

例外

brushnullbrush is null.

- 或 --or- pointsnullpoints is null.

示例

下面的代码示例旨在与 Windows 窗体一起使用,并且它需要作为 PaintEventArgs e Paint 事件处理程序的参数。The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 此代码执行以下操作:The code performs the following actions:

  • 创建一个纯红色画笔。Creates a solid red brush.

  • 创建一个由四个点组成的数组,用于定义样条。Creates an array of four points to define a spline.

  • 填充屏幕上的曲线。Fills the curve on the screen.

曲线的默认张力为0.5。The curve has a default tension of 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

注解

此方法填充经过数组中每个点的闭合基数样条的内部。This method fills the interior of a closed cardinal spline that passes through each point in the array. 如果最后一个点与第一个点不匹配,则从最后一个点向第一个点添加一个曲线段,以将其关闭。If the last point does not match the first point, an additional curve segment is added from the last point to the first point to close it.

点数组必须至少包含四个 PointF 结构。The array of points must contain at least four PointF structures.

此方法使用默认张力0.5。This method uses a default tension of 0.5.

适用于

FillClosedCurve(Brush, Point[], FillMode)

使用指定的填充模式填充 Point 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of Point structures using the specified fill mode.

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

确定填充特性的 BrushBrush that determines the characteristics of the fill.

points
Point[]

Point 结构数组,这些结构定义样条。Array of Point structures that define the spline.

fillmode
FillMode

FillMode 枚举的成员,它确定填充曲线的方式。Member of the FillMode enumeration that determines how the curve is filled.

例外

brushnullbrush is null.

- 或 --or- pointsnullpoints is null.

示例

下面的代码示例旨在与 Windows 窗体一起使用,并且它需要作为 PaintEventArgs e Paint 事件处理程序的参数。The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 此代码执行以下操作:The code performs the following actions:

  • 创建一个纯红色画笔。Creates a solid red brush.

  • 创建一个由四个点组成的数组,用于定义样条。Creates an array of four points to define a spline.

  • 将填充模式设置为 WindingSets the fill mode to Winding.

  • 填充屏幕上的曲线。Fills the curve on the screen.

曲线的默认张力为0.5。The curve has a default tension of 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

注解

此方法填充经过数组中每个点的闭合基数样条的内部。This method fills the interior of a closed cardinal spline that passes through each point in the array. 如果最后一个点与第一个点不匹配,则从最后一个点向第一个点添加一个曲线段,以将其关闭。If the last point does not match the first point, an additional curve segment is added from the last point to the first point to close it.

点数组必须至少包含四个 Point 结构。The array of points must contain at least four Point structures.

此方法使用默认张力0.5。This method uses a default tension of 0.5.

适用于

FillClosedCurve(Brush, PointF[], FillMode)

使用指定的填充模式填充 PointF 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of PointF structures using the specified fill mode.

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

确定填充特性的 BrushBrush that determines the characteristics of the fill.

points
PointF[]

PointF 结构数组,这些结构定义样条。Array of PointF structures that define the spline.

fillmode
FillMode

FillMode 枚举的成员,它确定填充曲线的方式。Member of the FillMode enumeration that determines how the curve is filled.

例外

brushnullbrush is null.

- 或 --or- pointsnullpoints is null.

示例

下面的代码示例旨在与 Windows 窗体一起使用,并且它需要作为 PaintEventArgs e Paint 事件处理程序的参数。The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 此代码执行以下操作:The code performs the following actions:

  • 创建一个纯红色画笔。Creates a solid red brush.

  • 创建一个由四个点组成的数组,用于定义样条。Creates an array of four points to define a spline.

  • 将填充模式设置为 WindingSets the fill mode to Winding.

  • 填充屏幕上的曲线。Fills the curve on the screen.

曲线的默认张力为0.5。The curve has a default tension of 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

注解

此方法填充经过数组中每个点的闭合基数样条的内部。This method fills the interior of a closed cardinal spline that passes through each point in the array. 如果最后一个点与第一个点不匹配,则从最后一个点向第一个点添加一个曲线段,以将其关闭。If the last point does not match the first point, an additional curve segment is added from the last point to the first point to close it.

点数组必须至少包含四个 Point 结构。The array of points must contain at least four Point structures.

此方法使用默认张力0.5。This method uses a default tension of 0.5.

适用于

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

使用指定的填充模式和张力填充 Point 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of Point structures using the specified fill mode and tension.

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

确定填充特性的 BrushBrush that determines the characteristics of the fill.

points
Point[]

Point 结构数组,这些结构定义样条。Array of Point structures that define the spline.

fillmode
FillMode

FillMode 枚举的成员,它确定填充曲线的方式。Member of the FillMode enumeration that determines how the curve is filled.

tension
Single

大于或等于 0.0F 的值,该值指定曲线的张力。Value greater than or equal to 0.0F that specifies the tension of the curve.

例外

brushnullbrush is null.

- 或 --or- pointsnullpoints is null.

示例

下面的代码示例旨在与 Windows 窗体一起使用,并且它需要作为 PaintEventArgs e Paint 事件处理程序的参数。The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 此代码执行以下操作:The code performs the following actions:

  • 创建一个纯红色画笔。Creates a solid red brush.

  • 创建一个由四个点组成的数组,用于定义样条。Creates an array of four points to define a spline.

  • 将填充模式设置为 WindingSets the fill mode to Winding.

  • 将张力设置为1.0。Sets the tension to 1.0.

  • 填充屏幕上的曲线。Fills the curve on the screen.

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

注解

此方法填充经过数组中每个点的闭合基数样条的内部。This method fills the interior of a closed cardinal spline that passes through each point in the array. 如果最后一个点与第一个点不匹配,则从最后一个点向第一个点添加一个曲线段,以将其关闭。If the last point does not match the first point, an additional curve segment is added from the last point to the first point to close it.

点数组必须至少包含四个 Point 结构。The array of points must contain at least four Point structures.

tension参数确定样条的形状。The tension parameter determines the shape of the spline. 如果参数的值 tension 为 0.0 f,此方法将绘制直线段以连接点。If the value of the tension parameter is 0.0F, this method draws straight line segments to connect the points. 通常, tension 参数小于或等于 1.0 f。Usually, the tension parameter is less than or equal to 1.0F. 超过 1.0 F 的值会产生异常结果。Values over 1.0F produce unusual results.

适用于

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

使用指定的填充模式和张力填充 PointF 结构数组定义的闭合基数样条曲线的内部。Fills the interior of a closed cardinal spline curve defined by an array of PointF structures using the specified fill mode and tension.

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

确定填充特性的 BrushA Brush that determines the characteristics of the fill.

points
PointF[]

PointF 结构数组,这些结构定义样条。Array of PointF structures that define the spline.

fillmode
FillMode

FillMode 枚举的成员,它确定填充曲线的方式。Member of the FillMode enumeration that determines how the curve is filled.

tension
Single

大于或等于 0.0F 的值,该值指定曲线的张力。Value greater than or equal to 0.0F that specifies the tension of the curve.

例外

brushnullbrush is null.

- 或 --or- pointsnullpoints is null.

示例

下面的代码示例旨在与 Windows 窗体一起使用,并且它需要作为 PaintEventArgs e Paint 事件处理程序的参数。The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 此代码执行以下操作:The code performs the following actions:

  • 创建一个纯红色画笔。Creates a solid red brush.

  • 创建一个由四个点组成的数组,用于定义样条。Creates an array of four points to define a spline.

  • 将填充模式设置为 WindingSets the fill mode to Winding.

  • 将张力设置为1.0。Sets the tension to 1.0.

  • 填充屏幕上的曲线。Fills the curve on the screen.

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

注解

此方法填充经过数组中每个点的闭合基数样条的内部。This method fills the interior of a closed cardinal spline that passes through each point in the array. 如果最后一个点与第一个点不匹配,则从最后一个点向第一个点添加一个曲线段,以将其关闭。If the last point does not match the first point, an additional curve segment is added from the last point to the first point to close it.

点数组必须至少包含四个 Point 结构。The array of points must contain at least four Point structures.

tension参数确定样条的形状。The tension parameter determines the shape of the spline. 如果参数的值 tension 为 0.0 f,此方法将绘制直线段以连接点。If the value of the tension parameter is 0.0F, this method draws straight line segments to connect the points. 通常, tension 参数小于或等于 1.0 f。Usually, the tension parameter is less than or equal to 1.0F. 超过 1.0 F 的值会产生异常结果。Values over 1.0F produce unusual results.

适用于