QPixmap originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId());

 QString format = "png";
     QString initialPath = QDir::currentPath() + tr("/untitled.") + format;

     QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
                                initialPath,
                                tr("%1 Files (*.%2);;All Files (*)")
                                .arg(format.toUpper())
                                .arg(format));
     if (!fileName.isEmpty())
         originalPixmap.save(fileName, format.toAscii());

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-11-30
  • 2021-12-17
  • 2021-08-15
  • 2022-12-23
相关资源
相似解决方案