6
votes

I'm making a program that streams my screen to another computer(like TeamViewer), I'm using sockets, PIL ImageGrab, Tkinter.

Everything is fine but the screenshot I get from ImageGrab.grab() is without the mouse cursor, which is very important for my program purpose.

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

1
I don't have any actual knowledge of this, but... Get the mouse position and use those coords to draw an image of a mouse cursor on to the screenshot.posit labs

1 Answers

3
votes

The cursor isn't on the same layer as the desktop or game your playing, so a screenshot won't capture it (try printscreen and paste into mspaint). A workaround is to get the position of the cursor and draw it on the image. you could use win32gui.GetCursorPos(point) for windows.