在hellowrold程序基礎(chǔ)上繪制一個(gè)圓
只需修改OnPaint方法
本文引用地址:http://m.butianyuan.cn/article/201609/303402.htmLONG OnPaint(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
RECT rect;
HPEN hpen;
GetClientRect(hWnd,rect);
hdc = BeginPaint(hWnd,ps);
//hpen = GetStockPen(BLACK_PEN); //兩種創(chuàng)建畫(huà)筆的方法
hpen = CreatePen(PS_SOLID,2,RGB(0XFF,0X00,0X00));
HGDIOBJ oldpen = SelectObject(hdc,hpen);
Ellipse(hdc,10,10,200,200);
SelectObject(hdc,oldpen);
DeleteObject(hpen);
EndPaint(hWnd,ps);
return TRUE;
}
評(píng)論