QT QMainWindow 截屏
2022-11-09 本文已影响0人
blue_lights
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("截取了主屏幕");}