Multiple users on Reddit have found the code base which indicates that this feature is in the Android Nougat, but not fully exposed at the moment.
In a video, a Reddit user has posted on YouTube, by changing the code in line 53 of takescreenshotservice to screenshotpartial(), you can already activate the feature on the Nexus 4. In this case, the user – Maxr1998 – is running a custom ROM; the NitrogenOS ROM.
Another Reddit user has also been able to activate the service using a physical keyboard and an USB On-The-Go (OTG) cable.
Google hasn’t exposed this feature yet, but the fact that it is hidden in the Nougat codebase means that the Mountain View based search giant is working on it and will perhaps expose it in the future.
On phones like the Samsung Galaxy S7, users can already have custom partial screenshots where the user gets the option to crop them using an in-built system feature. Stock Android as of now doesn’t have this feature.