MFC编程中画园的函数Ellipse与画矩形的函数Rectangle好像都是画实心图形的,怎样画空心的呢?
若以下回答无法解决问题,邀请你更新回答
1个回答
展开全部
话空心圆的例子
HDC hDC;
HBRUSH hBr, hOldBr;
HPEN hPen,hOldPen;
hDC=GetDC(hWnd);
hPen=::CreatePen(PS_SOLID,1,RGB(0,0,255));
hOldPen=(HPEN)SelectObject(hDC,hPen);
// Draw ellipse.
hBr = (HBRUSH) GetStockObject (NULL_BRUSH);
hOldBr = (HBRUSH) SelectObject (hDC, hBr);
Ellipse (hDC, 10, 90, 90, 170);
SelectObject (hDC, hOldBr);
删除Object (hBr);
SelectObject (hDC, hOldPen);
删除Object (hPen);
ReleaseDC(hWnd, hDC);
HDC hDC;
HBRUSH hBr, hOldBr;
HPEN hPen,hOldPen;
hDC=GetDC(hWnd);
hPen=::CreatePen(PS_SOLID,1,RGB(0,0,255));
hOldPen=(HPEN)SelectObject(hDC,hPen);
// Draw ellipse.
hBr = (HBRUSH) GetStockObject (NULL_BRUSH);
hOldBr = (HBRUSH) SelectObject (hDC, hBr);
Ellipse (hDC, 10, 90, 90, 170);
SelectObject (hDC, hOldBr);
删除Object (hBr);
SelectObject (hDC, hOldPen);
删除Object (hPen);
ReleaseDC(hWnd, hDC);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询