How to take a screenshot or photo through camera in game and use it in widget?

Hi, look at this plugin on UE Marketplace, it can exactly solve your problem!
Screenshot as Texture2D in Code Plugins - UE Marketplace (unrealengine.com)