qt截屏模块
代码:
#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(); }