Unsolved Exporting QGraphicsScene to transparent PNG?
-
Is there a way to export a QGraphicsScene to a transparent PNG, where the QGraphicsItems are painted over the transparent background? Using QGraphicsScene::render() to a QImage created with QImage.Format_RGB32 just makes a PNG with a black background. Not so nice.
Thanks!
-
@patrickkidd
Before you save QImage, you can set QImage format as QImage::Format_ARGB32
It puts transparent background instead black background. -
@samdol said in Exporting QGraphicsScene to transparent PNG?:
@patrickkidd
Before you save QImage, you can set QImage format as QImage::Format_ARGB32
It puts transparent background instead black background.So it does. You know, I overlooked that and had thought I was using Format_ARGB32 but was actually not. Thanks for the second set of eyes!