Graphics.FillRectangles Metoda

Definicja

Wypełnia wnętrza serii prostokątów określonych przez Rectangle struktury.

Przeciążenia

FillRectangles(Brush, ReadOnlySpan<RectangleF>)
FillRectangles(Brush, ReadOnlySpan<Rectangle>)
FillRectangles(Brush, RectangleF[])

Wypełnia wnętrza serii prostokątów określonych przez RectangleF struktury.

FillRectangles(Brush, Rectangle[])

Wypełnia wnętrza serii prostokątów określonych przez Rectangle struktury.

FillRectangles(Brush, ReadOnlySpan<RectangleF>)

Źródło:
Graphics.cs
public:
 void FillRectangles(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::RectangleF> rects);
public void FillRectangles (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.RectangleF> rects);
member this.FillRectangles : System.Drawing.Brush * ReadOnlySpan<System.Drawing.RectangleF> -> unit
Public Sub FillRectangles (brush As Brush, rects As ReadOnlySpan(Of RectangleF))

Parametry

brush
Brush

Dotyczy

FillRectangles(Brush, ReadOnlySpan<Rectangle>)

Źródło:
Graphics.cs
public:
 void FillRectangles(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::Rectangle> rects);
public void FillRectangles (System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.Rectangle> rects);
member this.FillRectangles : System.Drawing.Brush * ReadOnlySpan<System.Drawing.Rectangle> -> unit
Public Sub FillRectangles (brush As Brush, rects As ReadOnlySpan(Of Rectangle))

Parametry

brush
Brush

Dotyczy

FillRectangles(Brush, RectangleF[])

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

Wypełnia wnętrza serii prostokątów określonych przez RectangleF struktury.

public:
 void FillRectangles(System::Drawing::Brush ^ brush, cli::array <System::Drawing::RectangleF> ^ rects);
public:
 void FillRectangles(System::Drawing::Brush ^ brush, ... cli::array <System::Drawing::RectangleF> ^ rects);
public void FillRectangles (System.Drawing.Brush brush, System.Drawing.RectangleF[] rects);
public void FillRectangles (System.Drawing.Brush brush, params System.Drawing.RectangleF[] rects);
member this.FillRectangles : System.Drawing.Brush * System.Drawing.RectangleF[] -> unit
Public Sub FillRectangles (brush As Brush, rects As RectangleF())
Public Sub FillRectangles (brush As Brush, ParamArray rects As RectangleF())

Parametry

brush
Brush

Brush określa charakterystykę wypełnienia.

rects
RectangleF[]

Tablica struktur reprezentujących RectangleF prostokąty do wypełnienia.

Wyjątki

brush to null.

-lub-

rects to null.

Rects jest tablicą o zerowej długości.

Przykłady

Poniższy przykład kodu jest przeznaczony do użycia z Windows Forms i wymaga PaintEventArgseparametru Paint programu obsługi zdarzeń. Kod wykonuje następującą akcję:

  • Tworzy niebieski pędzel.

  • Tworzy tablicę trzech prostokątów.

  • Wypełnia trzy prostokątne obszary na ekranie.

public:
   void FillRectanglesRectangleF( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );

      // Create array of rectangles.
      array<RectangleF>^ rects = {RectangleF(0.0F,0.0F,100.0F,200.0F),RectangleF(100.0F,200.0F,250.0F,50.0F),RectangleF(300.0F,0.0F,50.0F,100.0F)};

      // Fill rectangles to screen.
      e->Graphics->FillRectangles( blueBrush, rects );
   }
private void FillRectanglesRectangleF(PaintEventArgs e)
{

    // Create solid brush.
    SolidBrush blueBrush = new SolidBrush(Color.Blue);

    // Create array of rectangles.
    RectangleF[] rects = { new RectangleF(0.0F, 0.0F, 100.0F, 200.0F), new RectangleF(100.0F, 200.0F, 250.0F, 50.0F), new RectangleF(300.0F, 0.0F, 50.0F, 100.0F) };

    // Fill rectangles to screen.
    e.Graphics.FillRectangles(blueBrush, rects);
}
Private Sub FillRectanglesRectangleF(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim blueBrush As New SolidBrush(Color.Blue)

    ' Create array of rectangles.
    Dim rects As RectangleF() = {New RectangleF(0.0F, 0.0F, 100.0F, 200.0F), _
    New RectangleF(100.0F, 200.0F, 250.0F, 50.0F), _
    New RectangleF(300.0F, 0.0F, 50.0F, 100.0F)}

    ' Fill rectangles to screen.
    e.Graphics.FillRectangles(blueBrush, rects)
End Sub

Dotyczy

FillRectangles(Brush, Rectangle[])

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

Wypełnia wnętrza serii prostokątów określonych przez Rectangle struktury.

public:
 void FillRectangles(System::Drawing::Brush ^ brush, cli::array <System::Drawing::Rectangle> ^ rects);
public:
 void FillRectangles(System::Drawing::Brush ^ brush, ... cli::array <System::Drawing::Rectangle> ^ rects);
public void FillRectangles (System.Drawing.Brush brush, System.Drawing.Rectangle[] rects);
public void FillRectangles (System.Drawing.Brush brush, params System.Drawing.Rectangle[] rects);
member this.FillRectangles : System.Drawing.Brush * System.Drawing.Rectangle[] -> unit
Public Sub FillRectangles (brush As Brush, rects As Rectangle())
Public Sub FillRectangles (brush As Brush, ParamArray rects As Rectangle())

Parametry

brush
Brush

Brush określa charakterystykę wypełnienia.

rects
Rectangle[]

Tablica struktur reprezentujących Rectangle prostokąty do wypełnienia.

Wyjątki

brush to null.

-lub-

rects to null.

rects jest tablicą o zerowej długości.

Przykłady

Poniższy przykład kodu jest przeznaczony do użycia z Windows Forms i wymaga PaintEventArgseparametru Paint programu obsługi zdarzeń. Kod wykonuje następującą akcję:

  • Tworzy niebieski pędzel.

  • Tworzy tablicę trzech prostokątów.

  • Wypełnia trzy prostokątne obszary na ekranie.

public:
   void FillRectanglesRectangle( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );

      // Create array of rectangles.
      array<Rectangle>^ rects = {Rectangle(0,0,100,200),Rectangle(100,200,250,50),Rectangle(300,0,50,100)};

      // Fill rectangles to screen.
      e->Graphics->FillRectangles( blueBrush, rects );
   }
private void FillRectanglesRectangle(PaintEventArgs e)
{

    // Create solid brush.
    SolidBrush blueBrush = new SolidBrush(Color.Blue);

    // Create array of rectangles.
    Rectangle[] rects = { new Rectangle(0, 0, 100, 200), new Rectangle(100, 200, 250, 50), new Rectangle(300, 0, 50, 100) };

    // Fill rectangles to screen.
    e.Graphics.FillRectangles(blueBrush, rects);
}
Private Sub FillRectanglesRectangle(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim blueBrush As New SolidBrush(Color.Blue)

    ' Create array of rectangles.
    Dim rects As Rectangle() = {New Rectangle(0, 0, 100, 200), _
    New Rectangle(100, 200, 250, 50), _
    New Rectangle(300, 0, 50, 100)}

    ' Fill rectangles to screen.
    e.Graphics.FillRectangles(blueBrush, rects)
End Sub

Dotyczy