thgis
29th October 2010, 13:27
Hi.
I have a problem saving a QImage.
It is generated from a QGraphicsScene via the following code:
QImage image(_scene->sceneRect().size().toSize(), QImage::Format_RGB32);
QPainter painter(&image);
_scene->render(&painter);
image.save(filename);
_scene is a QGraphicsScene*
and filename is a non empty string with the format("filename.png")
image.save(filename) always return false.
Another place in my program I save a QImage generated by setting individual pixels in the QImage and that works fine. (The format here is also .png)
I have tried different formats by changing the filename from filename.png to filename.tiff and so on.
Any ideas?
I have a problem saving a QImage.
It is generated from a QGraphicsScene via the following code:
QImage image(_scene->sceneRect().size().toSize(), QImage::Format_RGB32);
QPainter painter(&image);
_scene->render(&painter);
image.save(filename);
_scene is a QGraphicsScene*
and filename is a non empty string with the format("filename.png")
image.save(filename) always return false.
Another place in my program I save a QImage generated by setting individual pixels in the QImage and that works fine. (The format here is also .png)
I have tried different formats by changing the filename from filename.png to filename.tiff and so on.
Any ideas?