I know there are ways to take screenshot programmatically.
1. use MonkeyRunner through ADB and use USB cable for connection between PC and Android device.
http://developer.android.com/tools/help/MonkeyDevice.html#takeSnapshot
2. get from drawing cache for your developed APP only
https://stackoverflow.com/a/24280494/2080233
3. get from frame buffer, but not work for many app.
http://www.pocketmagic.net/android-native-screen-capture-application-using-the-framebuffer/
4. use /system/bin/screencap by root, but need to write into storage.
https://stackoverflow.com/a/15208592/2080233
I want to know if there is a way to grab a screenshot directly from memory and work great.