Graphics.FillRectangles Metoda

Definice

Vyplní interiéry řady obdélníků určených Rectangle strukturami.

Přetížení

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

Vyplní interiéry řady obdélníků určených RectangleF strukturami.

FillRectangles(Brush, Rectangle[])

Vyplní interiéry řady obdélníků určených Rectangle strukturami.

FillRectangles(Brush, ReadOnlySpan<RectangleF>)

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
public void FillRectangles (System.Drawing.Brush brush, scoped ReadOnlySpan<System.Drawing.RectangleF> rects);

Parametry

brush
Brush

Platí pro

.NET 9 a Windows Desktop 9
Produkt Verze
.NET 9
Windows Desktop 9

FillRectangles(Brush, ReadOnlySpan<Rectangle>)

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
public void FillRectangles (System.Drawing.Brush brush, scoped ReadOnlySpan<System.Drawing.Rectangle> rects);

Parametry

brush
Brush

Platí pro

.NET 9 a Windows Desktop 9
Produkt Verze
.NET 9
Windows Desktop 9

FillRectangles(Brush, RectangleF[])

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs

Vyplní interiéry řady obdélníků určených RectangleF strukturami.

public void FillRectangles (System.Drawing.Brush brush, System.Drawing.RectangleF[] rects);
public void FillRectangles (System.Drawing.Brush brush, params System.Drawing.RectangleF[] rects);

Parametry

brush
Brush

Brush určující vlastnosti výplně.

rects
RectangleF[]

Pole RectangleF struktur, které představují obdélníky, které se mají vyplnit.

Výjimky

brush je null.

-nebo-

rects je null.

Rects je pole nulové délky.

Příklady

Následující příklad kódu je určený pro použití s Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny události Paint. Kód provede následující akci:

  • Vytvoří pevný modrý štětec.

  • Vytvoří pole se třemi obdélníky.

  • Vyplní tři obdélníkové oblasti na obrazovce.

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);
}

Platí pro

.NET 9 a další verze
Produkt Verze
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

FillRectangles(Brush, Rectangle[])

Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs
Zdroj:
Graphics.cs

Vyplní interiéry řady obdélníků určených Rectangle strukturami.

public void FillRectangles (System.Drawing.Brush brush, System.Drawing.Rectangle[] rects);
public void FillRectangles (System.Drawing.Brush brush, params System.Drawing.Rectangle[] rects);

Parametry

brush
Brush

Brush určující vlastnosti výplně.

rects
Rectangle[]

Pole Rectangle struktur, které představují obdélníky, které se mají vyplnit.

Výjimky

brush je null.

-nebo-

rects je null.

rects je pole nulové délky.

Příklady

Následující příklad kódu je určený pro použití s Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny události Paint. Kód provede následující akci:

  • Vytvoří pevný modrý štětec.

  • Vytvoří pole se třemi obdélníky.

  • Vyplní tři obdélníkové oblasti na obrazovce.

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);
}

Platí pro

.NET 9 a další verze
Produkt Verze
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9