代码:

#include<QtCore/QString>
#include<QtGui>
#include<QtGui/QPixmap>

int main(int argc,char* argv[])
{
    QApplication app(argc,argv);
    
    QPixmap pixmap;
    pixmap=pixmap.grabWindow(QApplication::desktop()->winId());
    QString pic;
    pic="picture.jpg";
    pixmap.save(pic, "JPG");

    return app.exec(); 
}

 

相关文章:

  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-02-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2022-01-23
  • 2021-09-21
  • 2021-12-15
  • 2022-01-02
相关资源
相似解决方案