PDA

View Full Version : Screenshot



graciano
19th April 2009, 16:14
Hi

His there a way to make a Qt application take screenshots of herself (without system calls)?

Thanks

Lykurg
19th April 2009, 16:18
Hi, use QPixmap::grabWidget() or QPixmap::grabWindow().

nirva
19th April 2009, 16:24
Something like this:


QDesktopWidget *w = QApplication::desktop();
QPixmap screenshot = QPixmap::grabWindow(w->screen()->winId());


This takes a screenshot of the desktop.

graciano
19th April 2009, 16:32
Thanks ... i will try that.

Here is a good example: http://doc.trolltech.com/4.5/desktop-screenshot.html