Skip to content

Commit

Permalink
Gui: fix screenshot with opaque background
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder authored and wwmayer committed Jan 12, 2020
1 parent 20c85d9 commit 7484738
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Gui/SoFCOffscreenRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,9 @@ SoQtOffscreenRenderer::writeToImage (QImage& img) const
}
}
}
else if (PRIVATE(this)->backgroundcolor[3] == 1.0) {
img = img.convertToFormat(QImage::Format_RGB32);
}
}

/*!
Expand Down
3 changes: 2 additions & 1 deletion src/Gui/View3DInventorViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2111,7 +2111,8 @@ void View3DInventorViewer::imageFromFramebuffer(int width, int height, int sampl
bits++;
}
}
}
} else if (alpha == 255)
img = img.convertToFormat(QImage::Format_RGB32);
}

void View3DInventorViewer::renderToFramebuffer(QtGLFramebufferObject* fbo)
Expand Down

0 comments on commit 7484738

Please sign in to comment.