繁体   English   中英

对 tkinter 中的应用程序窗口/标签进行“截图”

[英]Take “screenshot” of application window/label in tkinter

I am working on some sort of animation maker with tkinter but I have run into a problem, i would want to save the current application window or canvas widget to a.png file for later use, is this possible? 提前致谢。

import pyautogui
myScreenshot = pyautogui.screenshot()
myScreenshot.save(r'Path to save screenshot\filename.png')

它就在那里! ^^

如果您不希望屏幕上显示其他所有内容,可以尝试使用 pil 裁剪它

如何使用 PIL 裁剪图像?

暂无
暂无

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

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