Graphics.FillRectangles(const Brush*, const RectF*, INT) method

Applies to: desktop apps only

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

Syntax

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

Parameters

  • brush [in]
    Type: const Brush*

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

  • rects [in]
    Type: const RectF*

    Pointer to an array of rectangles to be filled.

  • count [in]
    Type: INT

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

Return value

Type:

Type: Status****

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.

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

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics

Color

Rect

Status

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012