Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 7: GDI Accessories and Tools Visual C++ and MFC Fundamentals


The nFlags value specifies what edge(s) would be drawn. It can have one of the following
values:

Value Description
BF_RECT The entire rectangle will be drawn
BF_TOP Only the top side will be drawn
BF_LEFT Only the left side will be drawn
BF_BOTTOM Only the bottom side will be drawn
BF_RIGHT Only the right side will be drawn
BF_TOPLEFT Both the top and the left sides will be drawn
BF_BOTTOMLEFT Both the bottom and the left sides will be
drawn
BF_TOPRIGHT Both the top and the right sides will be
drawn
BF_BOTTOMRIGHT Both the bottom and the right sides will be
drawn
BF_DIAGONAL_ENDBOTTOMLEFT A diagonal line will be drawn from the top-
right to the bottom-left corners
BF_DIAGONAL_ENDBOTTOMRIGHT A diagonal line will be drawn from the top-
left to the bottom-right corners
BF_DIAGONAL_ENDTOPLEFT A diagonal line will be drawn from the
bottom-right to the top-left corners
BF_DIAGONAL_ENDTOPRIGHT A diagonal line will be drawn from the
bottom-left to the top-right corners

Here is an example:

void CExoView::OnDraw(CDC* pDC)
{
CRect Recto(20, 20, 225, 115);
pDC->DrawEdge(&Recto, BDR_RAISEDOUTER | BDR_SUNKENINNER, BF_RECT);
}

6.3.8 Ellipses and Circles.............................................................................

Free download pdf