screenshot
-
When I use the screen>grabWindow function to obtain screen pixel data, the program runs normally on Windows and Ubuntu desktop systems, but on embedded Linux systems, the function returns NULL. My code is as follows:
QScreen * screen=QGuiApplication:: primaryScreen();
QPixmap pixmap=screen ->grabWindow (0)// Return null value
Pixmap. save ("screenshot. png");
-
When I use the screen>grabWindow function to obtain screen pixel data, the program runs normally on Windows and Ubuntu desktop systems, but on embedded Linux systems, the function returns NULL. My code is as follows:
QScreen * screen=QGuiApplication:: primaryScreen();
QPixmap pixmap=screen ->grabWindow (0)// Return null value
Pixmap. save ("screenshot. png");
-
@NanLi Do you mean that
pixmap.isNull() == true
,screen == nullptr
, or that the PNG file is the correct size but blank? -
This is a duplicate of https://forum.qt.io/topic/151920/screenshot/2?_=1699508498491
Please stick to a single thread.
-
C Christian Ehrlicher locked this topic on