Color From Point?

Started by
2 comments, last by Anon Mike 16 years, 4 months ago
Anyone know the simple way to determine what color lies beneath a specific point on the screen? I remember it has something to do with device contexts and coordinate conversions, but I can't remember how to put it all together to make it work. Haven't dealt with graphics since before DX7.
Advertisement
In your app, or anywhere on entire screen (Windows + desktop)?
Either ...

I know why you're asking ... but I'm not sure what problems might be encountered in doing it one way or the other.

Ideally, for my immediate plans, I would like to be able to place a mouse cursor in a window outside of my application and read the color located at that location and the corresponding mouse coordinates. A lot of the application that I'm writing uses the mouse coordinate system and I'd like to be consistent with it.

But I'll take anything you can offer and can probably work from that to get where I need to be if it isn't right for my needs.

Thanks in advance for you efforts :)
GetDC(NULL), followed by GetPixel.
-Mike

This topic is closed to new replies.

Advertisement