BOOL FrameRgn(hdc, hrgn, hbr, nWidth, nHeight) | |||||
HDC hdc; | /* handle of device context | */ | |||
HRGN hrgn; | /* handle of region, */ | ||||
HBRUSH hbr; | /* handle of brush, */ | ||||
int nWidth; | /* width of region frame | */ | |||
int nHeight; | /* height of region frame | */ |
The FrameRgn function draws a border around the given region, using the specified brush.
hdc
Identifies the device context.
hrgn
Identifies the region to be enclosed in a border.
hbr
Identifies the brush to be used to draw the border.
nWidth
Specifies the width, in device units, of vertical brush strokes.
nHeight
Specifies the height, in device units, of horizontal brush strokes.
The return value is nonzero if the function is successful. Otherwise, it is zero.
The following example uses a blue brush to frame a rectangular region. Note that it is not necessary to select the brush or the region into the device context.
HRGN hrgn;
HBRUSH hBrush;
int Width = 5, Height = 2;
hrgn = CreateRectRgn(10, 10, 110, 110);
hBrush = CreateSolidBrush(RGB(0, 0, 255));
FrameRgn(hdc, hrgn, hBrush, Width, Height);
DeleteObject(hrgn);
DeleteObject(hBrush);