Direct screen pixel/framebuffer access [closed]

时光毁灭记忆、已成空白 提交于 2019-12-13 16:16:09

问题


I'd like to try and create a program playing a game. I.e. "a bot".

I want to be able to directly access the pixels on the screen. I.e. have my program "see" a game and then "make a move"(or at least draw a picture of what move it would make).

Both Windows and Linux advice is appreciated, though my guess is that it should be easier to do on Linux.

I'm guessing this could be done with some X/Gnome call?
I'm not afraid of C, even complex samples are welcome.


回答1:


SDL is a cross-platform library that allows you to directly access framebuffer pixels. You can learn about accessing the pixels on screen through the pixel access example on the documentation wiki.

Generally speaking, bots don't see the game graphics but see the underlying data structure instead, unless you are trying to do something related to computer vision.



来源:https://stackoverflow.com/questions/1934151/direct-screen-pixel-framebuffer-access

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!