Comparteix a través de


Graphics.FillClosedCurve Método

Definición

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras Point.

Sobrecargas

FillClosedCurve(Brush, Point[])

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras Point.

FillClosedCurve(Brush, PointF[])

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras PointF.

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

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras de Point utilizando el modo de relleno especificado.

FillClosedCurve(Brush, PointF[], FillMode)

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras de PointF utilizando el modo de relleno especificado.

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

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras de Point utilizando el modo de relleno y la tensión especificados.

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

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras de PointF utilizando el modo de relleno y la tensión especificados.

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

FillClosedCurve(Brush, Point[])

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras 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())

Parámetros

brush
Brush

Brush que determina las características del relleno.

points
Point[]

Matriz de estructuras de Point que definen la spline.

Excepciones

brush es null.

-o-

points es null.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, que es un parámetro del controlador de eventos Paint. El código realiza las siguientes acciones:

  • Crea un pincel rojo sólido.

  • Crea una matriz de cuatro puntos para definir una spline.

  • Rellena la curva en la pantalla.

La curva tiene una tensión predeterminada de 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

Comentarios

Este método rellena el interior de una spline cardinal cerrada que pasa por cada punto de la matriz. Si el último punto no coincide con el primer punto, se agrega un segmento de curva adicional desde el último punto hasta el primer punto para cerrarlo.

La matriz de puntos debe contener al menos cuatro estructuras Point.

Este método usa una tensión predeterminada de 0,5.

Se aplica a

FillClosedCurve(Brush, PointF[])

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras 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())

Parámetros

brush
Brush

Brush que determina las características del relleno.

points
PointF[]

Matriz de estructuras de PointF que definen la spline.

Excepciones

brush es null.

-o-

points es null.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, que es un parámetro del controlador de eventos Paint. El código realiza las siguientes acciones:

  • Crea un pincel rojo sólido.

  • Crea una matriz de cuatro puntos para definir una spline.

  • Rellena la curva en la pantalla.

La curva tiene una tensión predeterminada de 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

Comentarios

Este método rellena el interior de una spline cardinal cerrada que pasa por cada punto de la matriz. Si el último punto no coincide con el primer punto, se agrega un segmento de curva adicional desde el último punto hasta el primer punto para cerrarlo.

La matriz de puntos debe contener al menos cuatro estructuras PointF.

Este método usa una tensión predeterminada de 0,5.

Se aplica a

FillClosedCurve(Brush, ReadOnlySpan<Point>)

Source:
Graphics.cs
Source:
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))

Parámetros

brush
Brush

Se aplica a

FillClosedCurve(Brush, ReadOnlySpan<PointF>)

Source:
Graphics.cs
Source:
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))

Parámetros

brush
Brush

Se aplica a

FillClosedCurve(Brush, Point[], FillMode)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras de Point utilizando el modo de relleno especificado.

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)

Parámetros

brush
Brush

Brush que determina las características del relleno.

points
Point[]

Matriz de estructuras de Point que definen la spline.

fillmode
FillMode

Miembro de la enumeración FillMode que determina cómo se rellena la curva.

Excepciones

brush es null.

-o-

points es null.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, que es un parámetro del controlador de eventos Paint. El código realiza las siguientes acciones:

  • Crea un pincel rojo sólido.

  • Crea una matriz de cuatro puntos para definir una spline.

  • Establece el modo de relleno en Winding.

  • Rellena la curva en la pantalla.

La curva tiene una tensión predeterminada de 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

Comentarios

Este método rellena el interior de una spline cardinal cerrada que pasa por cada punto de la matriz. Si el último punto no coincide con el primer punto, se agrega un segmento de curva adicional desde el último punto hasta el primer punto para cerrarlo.

La matriz de puntos debe contener al menos cuatro estructuras Point.

Este método usa una tensión predeterminada de 0,5.

Se aplica a

FillClosedCurve(Brush, PointF[], FillMode)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras de PointF utilizando el modo de relleno especificado.

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)

Parámetros

brush
Brush

Brush que determina las características del relleno.

points
PointF[]

Matriz de estructuras de PointF que definen la spline.

fillmode
FillMode

Miembro de la enumeración FillMode que determina cómo se rellena la curva.

Excepciones

brush es null.

-o-

points es null.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, que es un parámetro del controlador de eventos Paint. El código realiza las siguientes acciones:

  • Crea un pincel rojo sólido.

  • Crea una matriz de cuatro puntos para definir una spline.

  • Establece el modo de relleno en Winding.

  • Rellena la curva en la pantalla.

La curva tiene una tensión predeterminada de 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

Comentarios

Este método rellena el interior de una spline cardinal cerrada que pasa por cada punto de la matriz. Si el último punto no coincide con el primer punto, se agrega un segmento de curva adicional desde el último punto hasta el primer punto para cerrarlo.

La matriz de puntos debe contener al menos cuatro estructuras Point.

Este método usa una tensión predeterminada de 0,5.

Se aplica a

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode)

Source:
Graphics.cs
Source:
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)

Parámetros

brush
Brush
fillmode
FillMode

Se aplica a

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode)

Source:
Graphics.cs
Source:
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)

Parámetros

brush
Brush
fillmode
FillMode

Se aplica a

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

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras de Point utilizando el modo de relleno y la tensión especificados.

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)

Parámetros

brush
Brush

Brush que determina las características del relleno.

points
Point[]

Matriz de estructuras de Point que definen la spline.

fillmode
FillMode

Miembro de la enumeración FillMode que determina cómo se rellena la curva.

tension
Single

Valor mayor o igual que 0,0F que especifica la tensión de la curva.

Excepciones

brush es null.

-o-

points es null.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, que es un parámetro del controlador de eventos Paint. El código realiza las siguientes acciones:

  • Crea un pincel rojo sólido.

  • Crea una matriz de cuatro puntos para definir una spline.

  • Establece el modo de relleno en Winding.

  • Establece la tensión en 1,0.

  • Rellena la curva en la pantalla.

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

Comentarios

Este método rellena el interior de una spline cardinal cerrada que pasa por cada punto de la matriz. Si el último punto no coincide con el primer punto, se agrega un segmento de curva adicional desde el último punto hasta el primer punto para cerrarlo.

La matriz de puntos debe contener al menos cuatro estructuras Point.

El parámetro tension determina la forma de la spline. Si el valor del parámetro tension es 0,0F, este método dibuja segmentos de línea recta para conectar los puntos. Normalmente, el parámetro tension es menor o igual que 1,0F. Los valores de más de 1.0F generan resultados inusuales.

Se aplica a

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

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Rellena el interior de una curva spline cardinal cerrada definida por una matriz de estructuras de PointF utilizando el modo de relleno y la tensión especificados.

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)

Parámetros

brush
Brush

Un Brush que determina las características del relleno.

points
PointF[]

Matriz de estructuras de PointF que definen la spline.

fillmode
FillMode

Miembro de la enumeración FillMode que determina cómo se rellena la curva.

tension
Single

Valor mayor o igual que 0,0F que especifica la tensión de la curva.

Excepciones

brush es null.

-o-

points es null.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, que es un parámetro del controlador de eventos Paint. El código realiza las siguientes acciones:

  • Crea un pincel rojo sólido.

  • Crea una matriz de cuatro puntos para definir una spline.

  • Establece el modo de relleno en Winding.

  • Establece la tensión en 1,0.

  • Rellena la curva en la pantalla.

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

Comentarios

Este método rellena el interior de una spline cardinal cerrada que pasa por cada punto de la matriz. Si el último punto no coincide con el primer punto, se agrega un segmento de curva adicional desde el último punto hasta el primer punto para cerrarlo.

La matriz de puntos debe contener al menos cuatro estructuras Point.

El parámetro tension determina la forma de la spline. Si el valor del parámetro tension es 0,0F, este método dibuja segmentos de línea recta para conectar los puntos. Normalmente, el parámetro tension es menor o igual que 1,0F. Los valores de más de 1.0F generan resultados inusuales.

Se aplica a

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

Source:
Graphics.cs
Source:
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)

Parámetros

brush
Brush
fillmode
FillMode
tension
Single

Se aplica a

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

Source:
Graphics.cs
Source:
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)

Parámetros

brush
Brush
fillmode
FillMode
tension
Single

Se aplica a