taking screenshots in a pyqt app
See original GitHub issueHi Marco, I hope all is well.
I’ve recently developed a pyqt application to make a GUI for brainrender
. This includes a QVTKRenderWindowInteractor
widget that replaces the default Plotter
used by the brainrender Scene
. See the docs for more details.
I’m trying to add a button to take screenshots, but it’s not working. It does take screenshots correctly (using vedo
’s screenshot
function), but the resulting images are empty (just a transparent or black background). Is there some issue with using QVTKRenderWindowInteractor
and taking screenshots at the same time?
In alternative I’ve also tried creating a new Plotter
instance without qtWidget
to use for taking the screenshot, but when I render that I just get an entirely red window and can’t see anything in the scene. The resulting screenshot is also an entirely red image. I don’t get any error or warning message.
Thank you for you help, Fede
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:14 (14 by maintainers)
Top GitHub Comments
oh cool, thank you so much for testing it out! I will give it a shot tomorrow 😃
Hi Federico …it’s a bug! it will be fixed in the next major release, for the moment you may try setting the window manually with this hack:
self.vp.window = self.vp.interactor.GetRenderWindow()
wherevp
is of classvedo.Plotter
andself
is of classQt.QMainWindow
(see examplevedo -r qt_window1
)