Visual C++ and MFC Fundamentals Chapter 7: GDI Accessories and Tools
6.3.9 Round Rectangles and Round Squares............................................
A rectangle qualifies as round if its corners do not form straight angles but rounded
corners. It can be illustrated as follows:
To draw such a rectangle, you can use the CDC::RoundRect() method. Its syntaxes are:
BOOL RoundRect(int x1, int y1, int x2, int y2, int x3, int y3);
BOOL RoundRect(PCRECT lpRect, POINT point);
When this member function executes, the rectangle is drawn from the (x1, y1) to the (x2,
y2) points. The corners are rounded by an ellipse whose width would be x3 and the
ellipse's height would be x3.
Here is an example:
void CExoView::OnDraw(CDC* pDC)
{
pDC->RoundRect(20, 20, 275, 188, 42, 38);
}