Gdi::FillRect_I

This method fills a rectangle using the specified brush. This method fills the left and top borders of the rectangle, but excludes the right and bottom borders.

static WINUSERAPI int WINAPI FillRect_I(
  HDC hDC, 
  CONST RECT* lprc, 
  HBRUSH hbr
);

Parameters

  • hDC
    [in] Handle to the device context.
  • lprc
    [in] Long pointer to a RECT structure that contains the logical coordinates of the rectangle to be filled.
  • hbr
    [in] Handle to the brush used to fill the rectangle.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

This method is an internal version of the FillRect function.

The brush identified by the hbr parameter may be either a handle to a logical brush or a color value. If specifying a handle to a logical brush, call Gdi::CreatePatternBrush_I or Gdi::CreateSolidBrush_I to obtain the handle. Additionally, you can retrieve a handle to one of the stock brushes by using the GetStockObject function. If specifying a color value for the hbr parameter, the value must be one of the standard system colors, and you must add 1 to the chosen color. The following code example shows how to specify a color value.

Gdi::FillRect_I(hdc, &rect, (HBRUSH) (COLOR_ENDCOLORS+1));

For a list of all the standard system colors, see GetSysColor.

When filling the specified rectangle, Gdi::FillRect_I does not include the right and bottom sides of the rectangle. GDI fills a rectangle up to, but not including, the right column and bottom row, regardless of the current mapping mode.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Gdi.hpp.

See Also

FillRect | GetStockObject | GetSysColor | Gdi::CreatePatternBrush_I | Gdi::CreateSolidBrush_I | RECT

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.