tags:

views:

127

answers:

2

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 slow :(

Can anybody suggest me a better method of doing this ?

+1  A: 

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

Dirk Eddelbuettel
I have seen the source code of ksnapshot and have also gone through the code of an example screenshot program on trolltech's website (http://doc.trolltech.com/4.2/desktop-screenshot.html), both of which use basically the same function. And I am even using that very function ( without the gui interface - I don't need the interface right now )
bhanuvrat
+1  A: 

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.

Andreas