From that request object, you call RequestScreenshot() to actually make the request and the engine will handle the rest.
BUT we can see three arguments there, what are they? Easy, but let's break it down:
"ScreenShot", //The output filename
true, //This one toggles to show the UI, the real star of this post.
false //Toggles the filename suffix, more on that below.
So the filename suffix...you thought that was gonna be lower didn't you? I guess I pulled a sneaky on ya.
If the Filename Suffix toggle was set to true your screenshots will be appended with 00000, 00001, 00002, 00003 and so on... Toggling it to false disables that as I use my own system of appending the current date. On or off? It's up to you. On is the default for the built-in screenshot tools.
That's all you need to get going but you'll notice a little bit of sneaky code in there:
I'll get through this quickly as it's not really necessary but it a bit convinient. You see; if we take a screenshot, sometimes Unreal is a bit too quick and will include the console in the screenshot too, we don't want that. All this does is:
/* Checks if a screenshot has already been requested,
not sure how we can get here without it being requested but it's a safety thing more than anything. */
FString ResponseMessage = TEXT("Screenshot saved to: " + request->GetFilename());
//Creates a string for a pop-up message box
FWindowsPlatformMisc::MessageBoxExt(EAppMsgType::Ok, *ResponseMessage, TEXT("Screenshot Taken"));
//Displays the message box.
This, essentially, slows down the taking of the screenshot just enough to make sure the console has been closed. This is more of a bandage over a bigger problem though, so no guarantees.
Now just compile it, open your PlayerController class and find the Cheat Manager entry in its defaults and change the Cheat Class to MyCheatManager. You may need to restart Unreal for it to show up.
And there you have it, just launch your project in PIE, toggle the debug camera and then type into the console TakeScreenShot, and you've got your screenshot with UI.