怎么在屏幕任意位置画图形啊
在屏幕任意位置画矩形啦,三角形啦之类的。有没有这样的api函数哇? I got itLRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HDC hdcScreen;
static HBRUSH hBrush;
switch (message)
{
case WM_CREATE:
hdcScreen = GetDC(0);
SetTimer(hwnd, 1, 20, NULL);
hBrush = CreateSolidBrush(RGB(255, 0, 0));
SelectObject(hdcScreen, (HGDIOBJ)hBrush);
return 0;
case WM_TIMER:
Rectangle(hdcScreen, 0, 0, 100, 200);
return 0;
case WM_DESTROY:
KillTimer(hwnd, 1);
DeleteObject((HGDIOBJ)hBrush);
ReleaseDC(0,hdcScreen);
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
页:
[1]