Save screenshots in gallery?

Hi there, i wonder how can i take a screenshot and save them directly in a gallery widget, instead of a folder. The idea is that the player will be able to take multiple pictures and download the ones them most like. Thanks!

Hello! You can have a scene capture component in your game and use it to capture screenshots and send the image to a saved Render Target. You can then access these targets you want to show in the widget.

However, you will still need to make as many render targets for the max amount of photos you would want to show up in the gallery.

To setup your scene capture, you will need to add the SceneCaptureComponent2D to whatever actor you want to be taking the screenshots. Make sure to turn off Capture Every Frame and Capture on Movement to save on performance.


You can switch out which render target you want to save the screenshot to and then reference it later for displaying in your gallery widget.

for the gallery part, dont precreate render targets. take the shot with the HighResShot console command or FScreenshotRequest, the png lands in Saved/Screenshots, then list that folder with FindFiles on *.png and load each file into a UTexture2D for the widget images. keep a reference to each texture so the gc dont eat them, and rebuild the list right after each shot so new pics show up without restart. for downloads, copy the picked png to the players chosen path with the platform file copy. you can also try Runtime Directory Watcher, a folder watcher for Unreal Engine that fires an event whenever a new screenshot lands so your gallery rebuilds itself: Runtime Directory Watcher — Hot-Folder File Events & Async Texture Loader | Fab