I have two questions related to my need: i want to save an in-game screenshot in a cpp variable. Do you know any way of doing it? Below i’ll leave two question about the way I’ve thought of doing it.
Question one, the preferred way:
Is there a way to take the screenshot and directly put it in a variable (maybe a UTexture2D) without saving it on the computer?I found out this method GEngine->GameViewport->Viewport->GetRenderTargetTexture()->GetTexture2D();, but it returns a FTexture2DRHIRef that is very low level.
Question two, the plan B: if question one is not possible, is there at least a clever way to get the name of the last saved screenshot after the invocation of GEngine->GameViewport->Viewport->TakeHighResScreenShot(); without rewriting the HighResScreenShot() function? So i will use the path to load it into a texture after the screenshot has been taken.
PS: i’m aware of the existence of FScreenshotRequest but i don’t understand how it should be used properly and if i can use it for my purpose.