【发布时间】:2017-01-19 07:55:20
【问题描述】:
是否可以从后台截取另一个应用程序的屏幕截图并将其转换为位图以在保存前进行一些更改?设备已植根。
我试过执行控制台命令,但它会自动将文件保存到磁盘,所以我需要读取文件、进行更改(显示给用户)并再次保存(或删除)。所以,要避免先保存。
顺便说一句,是否可以只显示特定区域而不是全屏?
【问题讨论】:
标签: android console screenshot superuser
是否可以从后台截取另一个应用程序的屏幕截图并将其转换为位图以在保存前进行一些更改?设备已植根。
我试过执行控制台命令,但它会自动将文件保存到磁盘,所以我需要读取文件、进行更改(显示给用户)并再次保存(或删除)。所以,要避免先保存。
顺便说一句,是否可以只显示特定区域而不是全屏?
【问题讨论】:
标签: android console screenshot superuser
如果您可以制作系统应用(使用与您的 Android 系统相同的密钥签名的应用),那么您可以使用 WindowManagerService.java API screenshotApplications() 返回屏幕截图的位图。
【讨论】:
另一种解决方案是使用MediaProjectionManager,在无根设备上使用21+ API。
【讨论】:
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
【讨论】: