I'm trying to get the colour of a pixel on the screen, but I can't find a method that has a sustainable tick rate.
So the first option I tried is the Robot class in Java - it's simple to use, but it just simply isn't fast enough.
I then found a way of capturing screen shots using JNA from this post. After testing and playing around with the code a bit, I found that I'm able to almost get what I wanted, mostly by modifying this line:
GDI32Extra.INSTANCE.BitBlt(hdcMemDC, 0, 0, width, height, hdcWindow, 0, 0, WinGDIExtra.SRCCOPY);
The only issue is that it still captures the whole window before picking out the single pixel that you want and it just doesn't seem right. This slows down the tick rate by quite a bit.
Is there any way I can capture just a single pixel, or am I forced to always capture an entire window first?
I'm pretty inexperienced with JNA's libraries so maybe I'm just missing something simple. If anyone could point me in the right direction, it would be much appreciated.
Thanks.