davidthewatson
20th August 2008, 14:55
Hi,
I am using Qt 4.3.4. I am trying to get a screen capture of a QGLWidget-derived object saved to a file. I followed the Qt Screenshot example. However, when I examine the image that I get from the following code:
QPixmap originalPixmap = QPixmap::grabWidget(qglThing);
originalPixmap.save("C:\\example.png", "png");
the image is simply a black box (which would be the bottom layer in my scene graph). Clearly, this doesn't behave the same as Windows alt-print screen mnemonic.
Is there something special that I have to do to grab the QGLWidget-derived image? Is this a bug? Or would I have to use an entirely different method?
Thanks,
David
I am using Qt 4.3.4. I am trying to get a screen capture of a QGLWidget-derived object saved to a file. I followed the Qt Screenshot example. However, when I examine the image that I get from the following code:
QPixmap originalPixmap = QPixmap::grabWidget(qglThing);
originalPixmap.save("C:\\example.png", "png");
the image is simply a black box (which would be the bottom layer in my scene graph). Clearly, this doesn't behave the same as Windows alt-print screen mnemonic.
Is there something special that I have to do to grab the QGLWidget-derived image? Is this a bug? Or would I have to use an entirely different method?
Thanks,
David