无需用户交互的屏幕截图
我正在构建一个应用程序,需要能够在后台运行时间歇性地捕获目标窗口的屏幕截图。也就是说,它需要能够在没有用户交互的情况下截取特定窗口的屏幕截图。。
举例来说,我打开了 Photoshop,我想每隔几分钟捕获打开的 Photoshop 文档的屏幕截图,并将捕获的内容保存到文件中,本质上是构建文档随时间变化的可视化历史记录。
目前我正在寻找 Unix/Mac 解决方案,但 Window 的建议受到热烈欢迎。
屏幕截图和Scrot 都需要鼠标交互来定位窗口和窗口。根据我的研究,Imagemagick 需要启动 xwd 才能获取目标窗口的 id。
我正在寻找一个轻量级的解决方案(我可以将其与我的软件捆绑在一起),或者理想情况下是一个已经内置到操作系统中的解决方案来完成此任务。
任何建议将不胜感激。干杯。
I'm building an app that needs to be able to take intermittent screen captures of a target window while running in the background. That is, it needs to be able to screenshot a specific window without user interaction.
Say for example I have Photoshop open, I'd like to capture a screenshot of my open Photoshop document every few minutes and save the capture to a file, essentially building a visual history of how the document has changed over time.
Currently I'm searching for a Unix/Mac solution but Window's suggestions are warmly welcomed.
Screencapture & Scrot both require mouse interaction to target a window & from what I've researched Imagemagick requires xwd to launch to get the id of the target window.
I'm looking for a lightweight solution (that I can bundle with my software) or ideally a solution already built into the OS to accomplish this.
Any suggestions would be very much appreciated. Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
xwd 实用程序可以转储特定的 X11 窗口内容。它接受要转储的窗口 ID 作为参数,并且可以在非交互模式下使用。
xwd utility can dump particular X11 window content. It accepts window ID to dump as an argument and can be used in non-interactive mode.
要以非交互方式捕获任何 UNIX/Linux 上的整个 X 桌面,您可以调用:
显示转储:
To capture the whole X-desktop on any unix/linux non-interactively you can call:
To display the dump: