Add screenshot button to export current screen content
Closed, ResolvedPublic


SDL_Surface * surf = SDL_CreateRGBSurfaceFrom(pixels, w, h, 8*4, w*4, 0,0,0,0);
SDL_SaveBMP(surf, filename);

Would that really save much time/effort?

I do:
Alt + Printscreen with the visualizer open and then on Ctrl+V
Even having to type in a filename to save would take me longer...

BAndiT1983 added a comment.EditedMay 4 2020, 7:15 PM

It's really not a lot of code to do and would save only the framebuffer to file. Just a nice to have feature, like we did it for OC.

PS: Also i see it as a task for newcomers, so they can learn the visualiser structure.

Understood and convinced :)

MarkusEngsner added a subscriber: MarkusEngsner.

I created a pull request for this:

Changes made:

  • Moved the 'Simulate LCD' and 'Debug overlay' buttons slightly upwards, to make room for the screenshot button.
  • Added the screenshot button and a corresponding handler, that saves a png with a timestamp as a name.
  • Added the screenshots/ subdirectory, in order for the screenshots not to bloat the main folders.
    • This required adding an empty .gitkeep file, to be able to commit the empty directory. This is needed, because IMG_SavePNG() refuses to create the directory.


And the saved screenshot:

sebastian closed this task as Resolved.May 27 2021, 9:22 PM