开发者

Screen capture without user interaction

开发者 https://www.devze.com 2023-04-03 18:52 出处:网络
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

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 in开发者_高级运维teraction.

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.


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.


To capture the whole X-desktop on any unix/linux non-interactively you can call:

xwd -root > file

To display the dump:

xwud -in file
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号