Computer Science Canada Need a quick help on getting the RGB of a pixel. |
Author: | HazySmoke)345 [ Sat Nov 19, 2005 7:47 pm ] | ||
Post subject: | Need a quick help on getting the RGB of a pixel. | ||
I'm trying to get the color of a pixel on the top left corner of the screen, so I typed
But the outcome is 13554646 always. Now, I'm not that clear about what I'm doing here... does "Me.hdc" confine the program to find the color of the pixel inside the form? If it does... how do I make it find the top left corner of the whole screen? |
Author: | Brightguy [ Sat Nov 19, 2005 10:31 pm ] | ||
Post subject: | Re: Need a quick help on getting the RGB of a pixel. | ||
Yes, Me.hdc will only return the device context handle to the form. I'm sure there are lots of ways to do this (e.g. CreateDC) but GetWindowDC seems to work fine:
|