Export (0) Print
Expand All

Graphics.FillClosedCurve Method

Fills the interior a closed cardinal spline curve defined by an array of Point structures.

Overload List

Fills the interior a closed cardinal spline curve defined by an array of Point structures.

[Visual Basic] Overloads Public Sub FillClosedCurve(Brush, Point())
[C#] public void FillClosedCurve(Brush, Point[]);
[C++] public: void FillClosedCurve(Brush*, Point[]);
[JScript] public function FillClosedCurve(Brush, Point[]);

Fills the interior a closed cardinal spline curve defined by an array of PointF structures.

[Visual Basic] Overloads Public Sub FillClosedCurve(Brush, PointF())
[C#] public void FillClosedCurve(Brush, PointF[]);
[C++] public: void FillClosedCurve(Brush*, PointF[]);
[JScript] public function FillClosedCurve(Brush, PointF[]);

Fills the interior a closed cardinal spline curve defined by an array of Point structures using the specified fill mode.

[Visual Basic] Overloads Public Sub FillClosedCurve(Brush, Point(), FillMode)
[C#] public void FillClosedCurve(Brush, Point[], FillMode);
[C++] public: void FillClosedCurve(Brush*, Point[], FillMode);
[JScript] public function FillClosedCurve(Brush, Point[], FillMode);

Fills the interior a closed cardinal spline curve defined by an array of PointF structures using the specified fill mode.

[Visual Basic] Overloads Public Sub FillClosedCurve(Brush, PointF(), FillMode)
[C#] public void FillClosedCurve(Brush, PointF[], FillMode);
[C++] public: void FillClosedCurve(Brush*, PointF[], FillMode);
[JScript] public function FillClosedCurve(Brush, PointF[], FillMode);

Fills the interior a closed cardinal spline curve defined by an array of Point structures using the specified fill mode and tension.

[Visual Basic] Overloads Public Sub FillClosedCurve(Brush, Point(), FillMode, Single)
[C#] public void FillClosedCurve(Brush, Point[], FillMode, float);
[C++] public: void FillClosedCurve(Brush*, Point[], FillMode, float);
[JScript] public function FillClosedCurve(Brush, Point[], FillMode, float);

Fills the interior a closed cardinal spline curve defined by an array of PointF structures using the specified fill mode and tension.

[Visual Basic] Overloads Public Sub FillClosedCurve(Brush, PointF(), FillMode, Single)
[C#] public void FillClosedCurve(Brush, PointF[], FillMode, float);
[C++] public: void FillClosedCurve(Brush*, PointF[], FillMode, float);
[JScript] public function FillClosedCurve(Brush, PointF[], FillMode, float);

Example

[Visual Basic, C#] The following example is designed for use with Windows Forms, and it requires PaintEventArgs e, 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.
  • Sets the fill mode to FillMode.Winding.
  • Sets the tension to 1.0.
  • Fills the curve on the screen.
[Visual Basic, C#] Note   This example shows how to use one of the overloaded versions of FillClosedCurve. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Public Sub FillClosedCurvePointFFillModeTension(e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create array of points for curve.
Dim point1 As New PointF(100F, 100F)
Dim point2 As New PointF(200F, 50F)
Dim point3 As New PointF(250F, 200F)
Dim point4 As New PointF(50F, 150F)
Dim points As PointF() =  {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 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);
}
        

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Graphics Class | Graphics Members | System.Drawing Namespace

Show:
© 2014 Microsoft