BOOL FillRgn(hdc, hrgn, hbr) | |||||
HDC hdc; | /* handle of device context | */ | |||
HRGN hrgn; | /* handle of region, */ | ||||
HBRUSH hbr; | /* handle of brush, */ |
The FillRgn function fills the given region by using the specified brush.
hdc
Identifies the device context.
hrgn
Identifies the region to be filled. The coordinates for the given region are specified in device units.
hbr
Identifies the brush to be used to fill the region.
The return value is nonzero if the function is successful. Otherwise, it is zero.
The following example uses a blue brush to fill a rectangular region. Note that it is not necessary to select the brush into the device context before using it to fill the region.
HRGN hrgn;
HBRUSH hBrush;
hrgn = CreateRectRgn(10, 10, 110, 110);
SelectObject(hdc, hrgn);
hBrush = CreateSolidBrush(RGB(0, 0, 255));
FillRgn(hdc, hrgn, hBrush);
DeleteObject(hrgn);
CreateBrushIndirect, CreateDIBPatternBrush, CreateHatchBrush, CreatePatternBrush, CreateSolidBrush, PaintRgn