QScreen *screen = QGuiApplication::primaryScreen();
QPixmap screenShot = screen->grabWindow(0);
if(screenShot.save(QDir::currentPath() + "screen_shot_main_window.jpg")) { printf("截取了主屏幕");}
QScreen *screen = QGuiApplication::primaryScreen();
QPixmap screenShot = screen->grabWindow(0);
if(screenShot.save(QDir::currentPath() + "screen_shot_main_window.jpg")) { printf("截取了主屏幕");}
本文标题:QT QMainWindow 截屏
本文链接:https://www.haomeiwen.com/subject/tkxntdtx.html
网友评论