I'm not sure how different the interface is on OneUI, but on my Pixel when I swipe up and hold on an app to open the App Switcher, there is a button below the app that takes a screenshot of just that app.
I don't remember when it was first introduced, but it is a feature of stock Android, so it should be present in some capacity on most Android phones.