Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Suggestion for capturing screen in full screen mode.
rakhijain last edited by
We need the suggestion for capturing screen in full screen mode.
Following are the requirement we are trying to achieve :
Application shall be in full screen mode – with no title bar. As it is full screen mode Windows task bar shall be not directly accessible.
We need to capture the full screen mode screen as screenshot in one of the directory.
We are using following code but actual screen is not captured. Instead, it captures white screen.
QScreen *screen = QGuiApplication::primaryScreen(); QPixmap pixMap = screen->grabWindow(0, 0,0,1920,1080); qDebug() << "Writing image to " << filename; QImage snapshot = pixMap.toImage(); snapshot.save(“C:\\test, nullptr, 100);
In Maximized mode it is working.
Any pointers for the same will be great help.
fcarney last edited by
Using a magic number of 0 for the WID is probably not a good idea. I would use the QWidget::winId function to get the ID.
Is this a QWidget? You could use grab from that to get a pixmap as well.