Include mouse cursor on screenshot

I am making a program that transfers my screen to another computer (e.g. TeamViewer), I use sockets, PIL ImageGrab, Tkinter.

Everything is fine, but the screenshot that I get from ImageGrab.grab() does not have a mouse pointer, which is very important for my purpose of the program.

Do you know how I can take a screenshot with the mouse cursor?

+5
source share
1 answer

The cursor is not at the same level as on the desktop or in the game, so the screenshot will not capture it (try printing the screen and pasting it into mspaint). The workaround is to get the cursor position and draw it on the image. you can use win32gui.GetCursorPos(point) for windows.

0
source

All Articles