Graphics.FillRectangles Graphics.FillRectangles Graphics.FillRectangles Method

定義

Rectangle 構造体で指定された一連の四角形の内部を塗りつぶします。Fills the interiors of a series of rectangles specified by Rectangle structures.

オーバーロード

FillRectangles(Brush, RectangleF[]) FillRectangles(Brush, RectangleF[]) FillRectangles(Brush, RectangleF[])

RectangleF 構造体で指定された一連の四角形の内部を塗りつぶします。Fills the interiors of a series of rectangles specified by RectangleF structures.

FillRectangles(Brush, Rectangle[]) FillRectangles(Brush, Rectangle[]) FillRectangles(Brush, Rectangle[])

Rectangle 構造体で指定された一連の四角形の内部を塗りつぶします。Fills the interiors of a series of rectangles specified by Rectangle structures.

FillRectangles(Brush, RectangleF[]) FillRectangles(Brush, RectangleF[]) FillRectangles(Brush, RectangleF[])

RectangleF 構造体で指定された一連の四角形の内部を塗りつぶします。Fills the interiors of a series of rectangles specified by RectangleF structures.

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

パラメーター

brush
Brush Brush Brush

塗りつぶしの特性を決定する BrushBrush that determines the characteristics of the fill.

rects
RectangleF[]

塗りつぶす四角形を表す RectangleF 構造体の配列。Array of RectangleF structures that represent the rectangles to fill.

例外

brushnullです。brush is null.

- または --or- rectsnullです。rects is null.

Rects は長さゼロの配列です。Rects is a zero-length array.

次のコード例は、Windows フォームで使用するように設計さPaintEventArgsれています。これはPaint 、イベントハンドラーのパラメーターであるを必要eとします。The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. このコードは、次のアクションを実行します。The code performs the following action:

  • 青の実線ブラシを作成します。Creates a solid blue brush.

  • 3つの四角形の配列を作成します。Creates an array of three rectangles.

  • 画面上の3つの四角形領域を塗りつぶします。Fills the three rectangular areas on the screen.

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

FillRectangles(Brush, Rectangle[]) FillRectangles(Brush, Rectangle[]) FillRectangles(Brush, Rectangle[])

Rectangle 構造体で指定された一連の四角形の内部を塗りつぶします。Fills the interiors of a series of rectangles specified by Rectangle structures.

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

パラメーター

brush
Brush Brush Brush

塗りつぶしの特性を決定する BrushBrush that determines the characteristics of the fill.

rects
Rectangle[]

塗りつぶす四角形を表す Rectangle 構造体の配列。Array of Rectangle structures that represent the rectangles to fill.

例外

brushnullです。brush is null.

- または --or- rectsnullです。rects is null.

rects は長さゼロの配列です。rects is a zero-length array.

次のコード例は、Windows フォームで使用するように設計さPaintEventArgsれています。これはPaint 、イベントハンドラーのパラメーターであるを必要eとします。The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. このコードは、次のアクションを実行します。The code performs the following action:

  • 青の実線ブラシを作成します。Creates a solid blue brush.

  • 3つの四角形の配列を作成します。Creates an array of three rectangles.

  • 画面上の3つの四角形領域を塗りつぶします。Fills the three rectangular areas on the screen.

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

適用対象