win7下Qt5获取桌面截图

os:window7

Qt:5.3

//begin:get system desktop and save it as a QPixmap.
    QScreen* screen = QGuiApplication::primaryScreen();
    //return the desktop window(root window).
    QDesktopWidget* desktop = QApplication::desktop();
    //get the geometry size of desktop.
    QRect rect = desktop->screenGeometry();

    //grab the contents of the given window resticted by Wid & QRect.
    mFullScreen = screen->grabWindow(desktop->winId(), 0, 0, rect.width(), rect.height());
    pLabelFullScreen->setPixmap(mFullScreen);
    pLabelFullScreen->showFullScreen();
    //end:get system desktop and save it as a QPixmap.


阅读更多
个人分类: Qt
上一篇Qt5 中关于信号槽的改动
下一篇Qt5 中关于信号槽的改动
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭