Graphics::FillRectangle(constBrush*,constRectF&) method (gdiplusgraphics.h)

The Graphics::FillRectangle method uses a brush to fill the interior of a rectangle.

Syntax

Status FillRectangle(
  const Brush   *brush,
  const RectF & rect
);

Parameters

brush

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

rect

Reference to the rectangle to be filled.

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

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

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

   // Create a RectF object.
   RectF fillRect(1.0f, 2.5f, 100.3f, 100.9f);

   // Fill the rectangle.
   graphics.FillRectangle(&blackBrush, fillRect);
}

Requirements

Requirement Value
Header gdiplusgraphics.h

See also

Graphics

Color

Rect

StringFormat