Udostępnij za pośrednictwem


Graphics.FillClosedCurve Metoda

Definicja

Wypełnia wnętrze zamkniętej krzywej krzywej spline kardynanej zdefiniowanej przez tablicę struktur Point.

Przeciążenia

FillClosedCurve(Brush, Point[])

Wypełnia wnętrze zamkniętej krzywej krzywej spline kardynanej zdefiniowanej przez tablicę struktur Point.

FillClosedCurve(Brush, PointF[])

Wypełnia wnętrze zamkniętej krzywej krzywej spline kardynanej zdefiniowanej przez tablicę struktur PointF.

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

Wypełnia wnętrze zamkniętej krzywej szprych kardynanej zdefiniowanej przez tablicę struktur Point przy użyciu określonego trybu wypełnienia.

FillClosedCurve(Brush, PointF[], FillMode)

Wypełnia wnętrze zamkniętej krzywej szprych kardynanej zdefiniowanej przez tablicę struktur PointF przy użyciu określonego trybu wypełnienia.

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

Wypełnia wnętrze zamkniętej krzywej szprych kardynanej zdefiniowanej przez tablicę struktur Point przy użyciu określonego trybu wypełnienia i napięcia.

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

Wypełnia wnętrze zamkniętej krzywej szprych kardynanej zdefiniowanej przez tablicę struktur PointF przy użyciu określonego trybu wypełnienia i napięcia.

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

FillClosedCurve(Brush, Point[])

Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs

Wypełnia wnętrze zamkniętej krzywej krzywej spline kardynanej zdefiniowanej przez tablicę struktur 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())

Parametry

brush
Brush

Brush, który określa cechy wypełnienia.

points
Point[]

Tablica struktur Point definiujących szprychę.

Wyjątki

brush jest null.

-lub-

points jest null.

Przykłady

Poniższy przykład kodu jest przeznaczony do użycia z formularzami Systemu Windows i wymaga PaintEventArgse, który jest parametrem programu obsługi zdarzeń Paint. Kod wykonuje następujące akcje:

  • Tworzy solidną czerwoną szczotkę.

  • Tworzy tablicę czterech punktów w celu zdefiniowania linii spline.

  • Wypełnia krzywą na ekranie.

Krzywa ma domyślne napięcie 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

Uwagi

Ta metoda wypełnia wnętrze zamkniętej linii kardynanej, która przechodzi przez każdy punkt w tablicy. Jeśli ostatni punkt nie pasuje do pierwszego punktu, dodatkowy segment krzywej zostanie dodany od ostatniego punktu do pierwszego punktu, aby go zamknąć.

Tablica punktów musi zawierać co najmniej cztery struktury Point.

Ta metoda używa domyślnego napięcia 0,5.

Dotyczy

FillClosedCurve(Brush, PointF[])

Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs

Wypełnia wnętrze zamkniętej krzywej krzywej spline kardynanej zdefiniowanej przez tablicę struktur 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())

Parametry

brush
Brush

Brush, który określa cechy wypełnienia.

points
PointF[]

Tablica struktur PointF definiujących szprychę.

Wyjątki

brush jest null.

-lub-

points jest null.

Przykłady

Poniższy przykład kodu jest przeznaczony do użycia z formularzami Systemu Windows i wymaga PaintEventArgse, który jest parametrem programu obsługi zdarzeń Paint. Kod wykonuje następujące akcje:

  • Tworzy solidną czerwoną szczotkę.

  • Tworzy tablicę czterech punktów w celu zdefiniowania linii spline.

  • Wypełnia krzywą na ekranie.

Krzywa ma domyślne napięcie 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

Uwagi

Ta metoda wypełnia wnętrze zamkniętej linii kardynanej, która przechodzi przez każdy punkt w tablicy. Jeśli ostatni punkt nie pasuje do pierwszego punktu, dodatkowy segment krzywej zostanie dodany od ostatniego punktu do pierwszego punktu, aby go zamknąć.

Tablica punktów musi zawierać co najmniej cztery struktury PointF.

Ta metoda używa domyślnego napięcia 0,5.

Dotyczy

FillClosedCurve(Brush, ReadOnlySpan<Point>)

Źródło:
Graphics.cs
Źródło:
Graphics.cs
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::Point> points);
public void FillClosedCurve (System.Drawing.Brush brush, 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))

Parametry

brush
Brush

Dotyczy

FillClosedCurve(Brush, ReadOnlySpan<PointF>)

Źródło:
Graphics.cs
Źródło:
Graphics.cs
public:
 void FillClosedCurve(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::PointF> points);
public void FillClosedCurve (System.Drawing.Brush brush, 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))

Parametry

brush
Brush

Dotyczy

FillClosedCurve(Brush, Point[], FillMode)

Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs

Wypełnia wnętrze zamkniętej krzywej szprych kardynanej zdefiniowanej przez tablicę struktur Point przy użyciu określonego trybu wypełnienia.

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)

Parametry

brush
Brush

Brush, który określa cechy wypełnienia.

points
Point[]

Tablica struktur Point definiujących szprychę.

fillmode
FillMode

Element członkowski wyliczenia FillMode, który określa sposób wypełnienia krzywej.

Wyjątki

brush jest null.

-lub-

points jest null.

Przykłady

Poniższy przykład kodu jest przeznaczony do użycia z formularzami Systemu Windows i wymaga PaintEventArgse, który jest parametrem programu obsługi zdarzeń Paint. Kod wykonuje następujące akcje:

  • Tworzy solidną czerwoną szczotkę.

  • Tworzy tablicę czterech punktów w celu zdefiniowania linii spline.

  • Ustawia tryb wypełniania na wartość Winding.

  • Wypełnia krzywą na ekranie.

Krzywa ma domyślne napięcie 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

Uwagi

Ta metoda wypełnia wnętrze zamkniętej linii kardynanej, która przechodzi przez każdy punkt w tablicy. Jeśli ostatni punkt nie pasuje do pierwszego punktu, dodatkowy segment krzywej zostanie dodany od ostatniego punktu do pierwszego punktu, aby go zamknąć.

Tablica punktów musi zawierać co najmniej cztery struktury Point.

Ta metoda używa domyślnego napięcia 0,5.

Dotyczy

FillClosedCurve(Brush, PointF[], FillMode)

Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs

Wypełnia wnętrze zamkniętej krzywej szprych kardynanej zdefiniowanej przez tablicę struktur PointF przy użyciu określonego trybu wypełnienia.

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)

Parametry

brush
Brush

Brush, który określa cechy wypełnienia.

points
PointF[]

Tablica struktur PointF definiujących szprychę.

fillmode
FillMode

Element członkowski wyliczenia FillMode, który określa sposób wypełnienia krzywej.

Wyjątki

brush jest null.

-lub-

points jest null.

Przykłady

Poniższy przykład kodu jest przeznaczony do użycia z formularzami Systemu Windows i wymaga PaintEventArgse, który jest parametrem programu obsługi zdarzeń Paint. Kod wykonuje następujące akcje:

  • Tworzy solidną czerwoną szczotkę.

  • Tworzy tablicę czterech punktów w celu zdefiniowania linii spline.

  • Ustawia tryb wypełniania na wartość Winding.

  • Wypełnia krzywą na ekranie.

Krzywa ma domyślne napięcie 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

Uwagi

Ta metoda wypełnia wnętrze zamkniętej linii kardynanej, która przechodzi przez każdy punkt w tablicy. Jeśli ostatni punkt nie pasuje do pierwszego punktu, dodatkowy segment krzywej zostanie dodany od ostatniego punktu do pierwszego punktu, aby go zamknąć.

Tablica punktów musi zawierać co najmniej cztery struktury Point.

Ta metoda używa domyślnego napięcia 0,5.

Dotyczy

FillClosedCurve(Brush, ReadOnlySpan<Point>, FillMode)

Źródło:
Graphics.cs
Źródło:
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)

Parametry

brush
Brush
fillmode
FillMode

Dotyczy

FillClosedCurve(Brush, ReadOnlySpan<PointF>, FillMode)

Źródło:
Graphics.cs
Źródło:
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)

Parametry

brush
Brush
fillmode
FillMode

Dotyczy

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

Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs

Wypełnia wnętrze zamkniętej krzywej szprych kardynanej zdefiniowanej przez tablicę struktur Point przy użyciu określonego trybu wypełnienia i napięcia.

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)

Parametry

brush
Brush

Brush, który określa cechy wypełnienia.

points
Point[]

Tablica struktur Point definiujących szprychę.

fillmode
FillMode

Element członkowski wyliczenia FillMode, który określa sposób wypełnienia krzywej.

tension
Single

Wartość większa niż lub równa 0,0F, która określa napięcie krzywej.

Wyjątki

brush jest null.

-lub-

points jest null.

Przykłady

Poniższy przykład kodu jest przeznaczony do użycia z formularzami Systemu Windows i wymaga PaintEventArgse, który jest parametrem programu obsługi zdarzeń Paint. Kod wykonuje następujące akcje:

  • Tworzy solidną czerwoną szczotkę.

  • Tworzy tablicę czterech punktów w celu zdefiniowania linii spline.

  • Ustawia tryb wypełniania na wartość Winding.

  • Ustawia napięcie na 1,0.

  • Wypełnia krzywą na ekranie.

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

Uwagi

Ta metoda wypełnia wnętrze zamkniętej linii kardynanej, która przechodzi przez każdy punkt w tablicy. Jeśli ostatni punkt nie pasuje do pierwszego punktu, dodatkowy segment krzywej zostanie dodany od ostatniego punktu do pierwszego punktu, aby go zamknąć.

Tablica punktów musi zawierać co najmniej cztery struktury Point.

Parametr tension określa kształt linii spline. Jeśli wartość parametru tension wynosi 0,0F, ta metoda pobiera segmenty linii prostej w celu połączenia punktów. Zazwyczaj parametr tension jest mniejszy lub równy 1,0F. Wartości powyżej 1,0F generują nietypowe wyniki.

Dotyczy

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

Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs
Źródło:
Graphics.cs

Wypełnia wnętrze zamkniętej krzywej szprych kardynanej zdefiniowanej przez tablicę struktur PointF przy użyciu określonego trybu wypełnienia i napięcia.

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)

Parametry

brush
Brush

Brush, który określa cechy wypełnienia.

points
PointF[]

Tablica struktur PointF definiujących szprychę.

fillmode
FillMode

Element członkowski wyliczenia FillMode, który określa sposób wypełnienia krzywej.

tension
Single

Wartość większa niż lub równa 0,0F, która określa napięcie krzywej.

Wyjątki

brush jest null.

-lub-

points jest null.

Przykłady

Poniższy przykład kodu jest przeznaczony do użycia z formularzami Systemu Windows i wymaga PaintEventArgse, który jest parametrem programu obsługi zdarzeń Paint. Kod wykonuje następujące akcje:

  • Tworzy solidną czerwoną szczotkę.

  • Tworzy tablicę czterech punktów w celu zdefiniowania linii spline.

  • Ustawia tryb wypełniania na wartość Winding.

  • Ustawia napięcie na 1,0.

  • Wypełnia krzywą na ekranie.

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

Uwagi

Ta metoda wypełnia wnętrze zamkniętej linii kardynanej, która przechodzi przez każdy punkt w tablicy. Jeśli ostatni punkt nie pasuje do pierwszego punktu, dodatkowy segment krzywej zostanie dodany od ostatniego punktu do pierwszego punktu, aby go zamknąć.

Tablica punktów musi zawierać co najmniej cztery struktury Point.

Parametr tension określa kształt linii spline. Jeśli wartość parametru tension wynosi 0,0F, ta metoda pobiera segmenty linii prostej w celu połączenia punktów. Zazwyczaj parametr tension jest mniejszy lub równy 1,0F. Wartości powyżej 1,0F generują nietypowe wyniki.

Dotyczy

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

Źródło:
Graphics.cs
Źródło:
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)

Parametry

brush
Brush
fillmode
FillMode
tension
Single

Dotyczy

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

Źródło:
Graphics.cs
Źródło:
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)

Parametry

brush
Brush
fillmode
FillMode
tension
Single

Dotyczy