Home > Back-end >  I want to use QT screenshots, why after the operation without pictures appear on the surface of the
I want to use QT screenshots, why after the operation without pictures appear on the surface of the

Time:09-21

I want to use QT screenshots, why after the operation without pictures appear on the surface of the table? The code below

Void MainWindow: : Screenshot ()
{
QDebug () & lt; & lt;" Screenshot ";
QScreen * screen=QGuiApplication: : primaryScreen ();
QPixmap pixmap=screen - & gt; GrabWindow (QApplication: : desktop () - & gt; WinId ());
Pixmap. Save (" C: \ \ Users \ \ 93216 \ \ Desktop ", "JPG");
}

CodePudding user response:

File name may be wrong
  • Related