屏幕截图,保存前处理它

时间:2017-01-19 07:55:21

标签: android console screenshot superuser

是否可以从后台制作另一个应用的截图并将其转换为位图以在保存之前进行一些更改?设备扎根。

我已尝试执行控制台命令,但它会自动将文件保存到磁盘,因此我需要比读取文件,进行更改(向用户显示)并再次保存(或删除)。所以,要避免先保存。

不过,是否可以只屏蔽特定区域,而不是全屏?

3 个答案:

答案 0 :(得分:2)

如果你可以创建一个系统应用程序(使用与Android系统相同的密钥签名的应用程序),那么你可以使用 WindowManagerService.java API screenshotApplications()返回屏幕截图的位图

有关详情,请浏览WindowManagerService.java source

答案 1 :(得分:2)

另一个解决方案发现适用于21+ API的非root设备是使用MediaProjectionManager

Here example如何使用它和 here how to manage from service

答案 2 :(得分:1)

 No , you need to save the file before any processing is needed to be done on the image before. 
You can one thing is let the file be saved and then with proper permissions you can overwrite the file by :
1. creating a copy
2.making changes
3.deleting the original
4.renaming the changed file
相关问题