Graphics::FillRectangles(constBrush*,constRectF*,INT) method (gdiplusgraphics.h)

The Graphics::FillRectangles method uses a brush to fill the interior of a sequence of rectangles.

Syntax

Status FillRectangles(
  const Brush *brush,
  const RectF *rects,
  INT         count
);

Parameters

brush

Pointer to a Brush that is used to fill the interior of each rectangle.

rects

Pointer to an array of rectangles to be filled.

count

Integer that specifies the number of rectangles in the rects array.

Return value

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Remarks

Examples

The following example fills a sequence of rectangles.

VOID Example_FillRectangles2(HDC hdc)
{
   Graphics graphics(hdc);

   // Create a SolidBrush object.
   SolidBrush blackBrush(Color(255, 0, 0, 0));

   // Create an array of RectF objects.
   RectF rect1(0.0f, 0.0f, 100.0f, 200.0f);
   RectF rect2(100.5f, 200.5f, 200.5f, 50.5f);
   RectF rect3(300.8f, 0.8f, 50.8f, 150.8f);
   RectF rects[3] = {rect1, rect2, rect3};

   // Fill the rectangles.
   graphics.FillRectangles(&blackBrush, rects, 3);
}

Requirements

Requirement Value
Header gdiplusgraphics.h

See also

Color

Graphics

Rect

Status