Sentdex / pygta5

Explorations of Using Python to play Grand Theft Auto 5.
MIT License
3.91k stars 823 forks source link

Adding grabscreen for Non-Windows Platform #105

Closed jatinmandav closed 2 years ago

jatinmandav commented 6 years ago

Since ImageGrab from PIL or win32api won't work on Linux system, I have achieved this task using Gtk Library from gi.repository (sudo apt-get install python3-gi). Using ImageGrab from pyscreenshot resulted in a lot of lag. Using Gtk and Gdk, gives a decent rate of 30-40 fps event after all the image manipulations.

PeterGardas commented 6 years ago

Try this, it is really good https://github.com/Sentdex/pygta5/issues/13 gives alot of fps.

Peter Gardas

jatinmandav commented 6 years ago

Thanks! I will try that!

PeterGardas commented 6 years ago

No problem pal :D! Just dont forget to close this issue if this solves it :D

Peter Gardas

ScriptBono commented 6 years ago

@jatinmandav thank you for the workaround for Ubuntu. Unfortunately, I'm getting the following error on Ubuntu 17.10 when I use Opencv3 and GTK3 in the same project:

GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

It seems that Opencv3 and GTK3 are not compatible with each other. I installed both libraries via Anaconda and I'm struggling to find a workaround for that problem. Did anyone experience the same or has a solution for that problem?