标签:
//OnPaint
void OnPaint(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps = { 0 };
HDC hDC = BeginPaint(hWnd, &ps);
int marc = 0; //控制棋盘所在位置
for (int i = 0; i < 10; i++) //画九格横线
{
MoveToEx(hDC, marc + 50, marc + 50 + i * 50 , NULL);
LineTo(hDC, marc + 500, marc + 50 + i * 50);
}
for (int j = 0; j < 10; j++) //画九格直线
{
MoveToEx(hDC, marc + 50 + j * 50, marc + 50, NULL);
LineTo(hDC, marc + 50 + j * 50, marc + 500);
}
EndPaint(hWnd, &ps);
}
标签:
原文地址:http://www.cnblogs.com/nfking/p/5573141.html