Saturday, May 9, 2009

With C++ Builder, how could you get the color of any pixel of the screen ?

Hi,





For a C++ Builder project, I need to be able to get the color of any given pixel of the screen (especially including the portions of the desktop visible around my application). So far, by using the GetPixel method in the TForm1::MouseMove event, I have been able to get the color of the pixels within my form, but not outside of it (i.e. the desktop surrounding my application). Any idea or code that could help me solving that problem would be very welcome.





Thanks!

With C++ Builder, how could you get the color of any pixel of the screen ?
HDC hDC;


hDC = GetDC(NULL);


COLORREF clr = GetPixel(hDC, x, y);


ReleaseDC(hDC);


No comments:

Post a Comment