简体   繁体   English

在屏幕截图中包含鼠标光标

[英]Include mouse cursor in screenshot

I'm making a program that streams my screen to another computer(like TeamViewer), I'm using sockets, PIL ImageGrab, Tkinter. 我正在制作一个程序,将我的屏幕流式传输到另一台计算机(如TeamViewer),我正在使用套接字,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. 一切都很好,但我从ImageGrab.grab()获得的截图没有鼠标光标,这对我的程序目的非常重要。

Do you know how can I take screenshot with the mouse cursor? 你知道如何用鼠标光标截取屏幕截图吗?

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). 光标与您正在播放的桌面或游戏不在同一层,因此屏幕截图不会捕获它(尝试printcreen并粘贴到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. 你可以使用win32gui.GetCursorPos(point)的窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM