im trying to display image when left mouse button is down.
i can display the image but if the left mouse button is down again than the older image would be deleted.
here is my code
display image function
{ Graphics graphics(hdc); POINT pt; GetCursorPos(&pt); ScreenToClient(hWnd, &pt); Image shot(L"RegularShots.png"); graphics.DrawImage(&shot, pt.x, pt.y); }
left mouse button down
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?