|
-
Nov 15th, 2000, 11:39 AM
#1
Thread Starter
Hyperactive Member
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
-
Nov 15th, 2000, 11:55 AM
#2
transcendental analytic
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.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 2nd, 2000, 04:41 PM
#3
Thread Starter
Hyperactive Member
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?
-
Dec 2nd, 2000, 04:52 PM
#4
transcendental analytic
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.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|