Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Get a pixel color from anywhere on screen.

Status
Not open for further replies.

Alegendxx

Programmer
Dec 30, 2001
4
US
I want to grab pixel colors from any window on the screen. What's the Simpliest way to get a pixel color from anywhere on the screen?

Thanks
 
The way I use is: GetPixel (x,y) // member of CDC

Example:

CDC* pDC=GetDC();
LONG pixel;
pDC->GetPixel (10,10 );

that's what I use in my MFC programs when I need a simple function.
For the color value use: GetRValue, GetBValue, GetGValue ... in relation to the pixel value.

Hope I could help you !
regards,
SAM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top