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(); 
}

 

posted on 2013-01-02 10:21  小风儿_xf  阅读(650)  评论(0编辑  收藏  举报

导航