一个vc的api函数画图的问题
switch(iMessage){caseWM_LBUTTONDOWN:hDC=GetDC(hWnd);SetMapMode(hDC,MM_ANISOTROPIC);hP...
switch(iMessage)
{
case WM_LBUTTONDOWN:
hDC=GetDC(hWnd);
SetMapMode(hDC,MM_ANISOTROPIC);
hPen=(HPEN)GetStockObject(BLACK_PEN);
hBrush=(HBRUSH)GetStockObject(WHITE_BRUSH);
SelectObject(hDC,hBrush);
SelectObject(hDC,hPen);
Ellipse(hDC,200,320,100,300);
int ReleaseDC(hWnd,hDC);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return(DefWindowProc(hWnd,iMessage,wParam,lParam));
}
怎么错误呢,我想不明白。谁能指点下
BeginPaint不是在WM_PAINT消息下才用的吗, 展开
{
case WM_LBUTTONDOWN:
hDC=GetDC(hWnd);
SetMapMode(hDC,MM_ANISOTROPIC);
hPen=(HPEN)GetStockObject(BLACK_PEN);
hBrush=(HBRUSH)GetStockObject(WHITE_BRUSH);
SelectObject(hDC,hBrush);
SelectObject(hDC,hPen);
Ellipse(hDC,200,320,100,300);
int ReleaseDC(hWnd,hDC);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return(DefWindowProc(hWnd,iMessage,wParam,lParam));
}
怎么错误呢,我想不明白。谁能指点下
BeginPaint不是在WM_PAINT消息下才用的吗, 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询