截取全屏图片

#include <QScreen>

QScreen *screen;

//截取全屏图片
    screen=QGuiApplication::primaryScreen();
    fullScreenPixmap=QPixmap();
    fullScreenPixmap=screen->grabWindow(0,0,0,-1,-1);//-1-1表示获得全屏的图片
    this->setPixmap(fullScreenPixmap);

你可能感兴趣的:(截取全屏图片)