taking screenshot of device screen [duplicate]

2019-09-24 08:14发布

This question is an exact duplicate of:

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.

2条回答
\"骚年 ilove
2楼-- · 2019-09-24 08:22

You can get the drawing cache of your view using the following code:

    view.setDrawingCacheEnabled(true);
    view.buildDrawingCache();
    Bitmap b1 = view.getDrawingCache();
查看更多
相关推荐>>
3楼-- · 2019-09-24 08:22

You can use this:

$ adb shell screencap -p /mnt/sdcard/sc.png
$ adb pull /mnt/sdcard/sc.png
查看更多
登录 后发表回答