问题
I know this question has been asked many times.I am aware of two ways to do it.(1)Using screenshot library(But I am getting black screen all the time).(2)getting data from frame buffer with rooting||\dev\graphics\fb0||(But it is always 0 byte and I do not know exact location where current screenshot of device is stored).My preferred requirement is getting better frame rate.Any help will be very helpful as I have spent a lot of time in this.
回答1:
You can get the drawing cache of your view using the following code:
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
Bitmap b1 = view.getDrawingCache();
回答2:
You can use this:
$ adb shell screencap -p /mnt/sdcard/sc.png
$ adb pull /mnt/sdcard/sc.png
来源:https://stackoverflow.com/questions/15117870/taking-screenshot-of-device-screen