-2

Could someone make some code that gets the pixel of an x y coord on screen and explain how the code works. I have read other examples but I dont know what all the functions and code do. Thanks.

  • 2
    get pixel of what? there are lots of devices and platforms in the world. The way to do it in Windows is definitely different from Linux – phuclv May 15 '17 at 05:31
  • Hi, take a look at the [tour] and [how to ask a question](https://stackoverflow.com/help/how-to-ask) – Passer By May 15 '17 at 07:23

1 Answers1

1
HDC hdcScreen = GetDC(0);
COLORREF crPixel = GetPixel(hdcScreen, 10, 10);
ReleaseDC(0, hdcScreen);

Will store the displayed pixel at coordinates 10,10 into crPixel.

Is this what you were asking for?

CocoCrisp
  • 807
  • 1
  • 9
  • 26