Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <QApplication>
  2. #include <QDesktopWidget>
  3. #include <QPixmap>
  4.  
  5. int main(int argc, char **argv) {
  6.     QApplication app(argc, argv);
  7.     for (int s = 0; s < QApplication::desktop()->screenCount(); ++s)
  8.         QPixmap::grabWindow(QApplication::desktop()->screen(s)->winId()).save(QString("%0/desktop_%1.png").arg(QApplication::applicationDirPath()).arg(s));
  9.     return 0;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement