question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

taking screenshots in a pyqt app

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
FedeClaudicommented, Aug 18, 2020

oh cool, thank you so much for testing it out! I will give it a shot tomorrow 😃

1reaction
marcomusycommented, Aug 17, 2020

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() where vp is of class vedo.Plotter and self is of class Qt.QMainWindow (see example vedo -r qt_window1)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pyqt take screenshot of certain screen area - Stack Overflow
I have this app written in pyqt. You can view the source at http://www.pasteall.org/62739/python It takes screen shots of the desktop. what ...
Read more >
Make your own screenshot taker with pyQT5 - YouTube
... user not know ,how take screenshot in windows .You can use this application for own use and share this application with your...
Read more >
Screenshot Taker with Python - Medium
Take screenshots, and given an image (for example, of a button or checkbox), find it on the screen. Locate an application's window, and...
Read more >
Screenshot Example | Qt Widgets 6.4.1 - Qt Documentation
The Screenshot example shows how to take a screenshot of the desktop. With the application the users can take a screenshot of their...
Read more >
Adding images to PyQt5/PySide2 applications, using QLabel ...
Since you're wanting to insert an image you might be expecting to use a widget named QImage or similar, but that would make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found