Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Hi, I was wondering what is wrong with this code?
BOOL Test = FALSE;
hdc = BeginPaint(hWnd, &ps);
if (Test == FALSE)
SetPixel(hdc, 20, 20, 0x000000FF);
SetPixel(hdc, 200, 20, 0x0000FF00);
Test = TRUE;
What the code is supposed to do is clear. If the user doesn't leftclick in the Clientarea, a Red pixel is drawn at 20, 20. Else a green one is drawn at 200, 20.
I'm writing a digitalising program, so I don't know how many points I have to mark, but I thought that this code would draw a red pixel and after a leftclick a green one. The interesting thing is, that the red one stays there, but after scrolling the green one disappears. I want them both to stay, but how can I do that. What's wrong with my code???
0 · ·