开发者

How to take snapshot in linux - programmatically C++

开发者 https://www.devze.com 2022-12-30 11:41 出处:网络
I am currently involved in a project which requires me to repeatedly take snapshots of the screen. I am using qt\'s grabScreen function to do the same.

I am currently involved in a project which requires me to repeatedly take snapshots of the screen. I am using qt's grabScreen function to do the same. The screen freezes for half a second every time the program takes a snapshot causing the computer to seem to be very s开发者_开发百科low :(

Can anybody suggest me a better method of doing this ?


If you're OK with doing it in lower level manner, then you should look into one of those xorg tools that I can't remember the name of. It's installed by default and outputs the screenshot in a bitmap format. It's a shame I can't remember the name.

EDIT: I got it! It's "xwd". Cheers.


You could look at the source of, say, ksnapshot which is the Qt-based KDE app doing this. Its SVN archive is here.

0

精彩评论

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

关注公众号