QT实现截屏功能

QT中本身的截屏实现方式:

QPixmap pixmap = QPixmap::grabWindow(QApplication::desktop()->windId());

QDateTime dt = QDateTime::currentDateTime();

QString filename = QString("%1.jpg").arg(dt.toString("yyyyMMdd-hhmmss"));

pixmap.save("file save path/",filename);

猜你喜欢

转载自blog.csdn.net/houxiaoliwang/article/details/78130895