I am using
c = GetPixel(GetDC(GetDesktopWindow), x, y)
to obtain a screen image. I used it often, but now it returns only white &HFFFFFF (maybe I was using a little different trick). Where is the problem?
Thanx
John
Printable View
I am using
c = GetPixel(GetDC(GetDesktopWindow), x, y)
to obtain a screen image. I used it often, but now it returns only white &HFFFFFF (maybe I was using a little different trick). Where is the problem?
Thanx
John
The problem might be that you've ran out of resources, because every time you use GetDC, it creates a new device context. What you need to do is to either use ReleaseDC to remove it after use and/or store the handle in a long while you access all the pixels you need, then release it.
I found the trick - I was mispelled!
Yes! I wrote GetDekstopWindow - a variable equal to 0. And this works. Now I use GetDC(0) and it works beatufil. Why is than the GetDesktopWindow used for?
To get the desktop window handle, well you don't need it.
Just remember to release the DC or your app might screw up your system resources.