diff --git a/src/Gui/SoFCOffscreenRenderer.cpp b/src/Gui/SoFCOffscreenRenderer.cpp index b237a08800..d4eb3bc1ea 100644 --- a/src/Gui/SoFCOffscreenRenderer.cpp +++ b/src/Gui/SoFCOffscreenRenderer.cpp @@ -784,6 +784,8 @@ SoQtOffscreenRenderer::writeToImage (QImage& img) const c2.setBlueF(PRIVATE(this)->backgroundopaque[2]); c2.setAlphaF(PRIVATE(this)->backgroundopaque[3]); + QImage image(img.constBits(), img.width(), img.height(), QImage::Format_ARGB32); + img = image.copy(); QRgb rgba = c1.rgba(); QRgb rgb = c2.rgb(); QRgb * bits = (QRgb*) img.bits(); diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 8ac96ebe2b..66f6fc8800 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -1455,6 +1455,8 @@ void View3DInventorViewer::imageFromFramebuffer(int width, int height, int sampl // if background color isn't opaque manipulate the image if (alpha < 255) { + QImage image(img.constBits(), img.width(), img.height(), QImage::Format_ARGB32); + img = image.copy(); QRgb rgba = bgcolor.rgba(); QRgb rgb = bgopaque.rgb(); QRgb * bits = (QRgb*) img.bits();