0
即時嘗試顯示圖像時,鼠標左鍵關閉。
我可以顯示圖像,但如果鼠標左鍵再次下降,則會刪除較舊的圖像。
這裏是我的代碼
顯示圖像功能C++顯示多個圖像gid +
{ Graphics graphics(hdc); POINT pt; GetCursorPos(&pt); ScreenToClient(hWnd, &pt); Image shot(L"RegularShots.png"); graphics.DrawImage(&shot, pt.x, pt.y); }
鼠標左鍵
case WM_LBUTTONDOWN: RegularShots=0; InvalidateRect(hWnd, rect, false); break;
WM_PAINT
case WM_PAINT: hdc = BeginPaint(hWnd, &ps); OnPaint(hdc, hWnd, 1); if(RegularShots==0) { RegularShot(hdc, hWnd); } EndPaint(hWnd, &ps); break;
anyideas?
我想到了這一點。問題是如何在程序運行時存儲數組中的座標,我不知道鼠標左鍵會下降多少次 – Ramilol 2010-08-19 03:19:20
這就是矢量進入的地方 - 請參閱http://msdn.microsoft.com/en-us /library/9xd04bzs%28v=VS.80%29.aspx。 – 2010-08-19 03:26:40