如何从屏幕截图中排除叠加? [英] How to exclude overlay from screenshot?

查看:177
本文介绍了如何从屏幕截图中排除叠加?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于这个答案,我认为至少对于系统应用程序(或者也可能在有root权限的设备中)存在一个解决方案?).碰巧我不明白答案注释上链接的代码示例.有人可以解释一步一步来实现这一点(如果可能,请提供代码示例)?提前致谢.

Based in this answer I think that exists a solution at least to system apps (or probably also in rooted devices?). Happens that i not understood the code example linked on answer comments. Someone could explain a step by step to achieve this please (with a code example if possible)? Thanks in advance.

推荐答案

由于 androids 处理屏幕截图的方式,排除覆盖是不可能的.但是,如链接中所述,您可以制作没有叠加层的屏幕截图.

Because of androids way of handling screenshots, excluding the overlay is not possible. But you could, as stated in your link, make the screenshot without your overlay.

这会导致您的屏幕截图中出现未渲染的漏洞,其中只有黑色背景.

This would result in having unrendered holes in your screenshot, whrere there would be only a black background.

如果您愿意,您可以轻松地在拍摄屏幕截图的那一刻将覆盖层设为黑色,甚至禁用可见性,以获得干净的屏幕截图.为了给您一个更详细的答案,我们需要一个更精确的问题,其中包含您如何编写代码的示例和想法.

If you want that, you could easyly just make your overlay black of the second you shoot the screenshot, or even disable the visibility, to get a clean screenshot. To give you a more detailed answer, we would need a more prescise question with examples and ideas how you wrote your code.

问题是,理论上您可以深入研究 androids 源代码并更改屏幕截图行为.但是有了它,您将自己创建一个新的 Android 版本.正如@Hassan Uddin 所说.在你的手机上运行它需要你深入挖掘 androids 源代码,并且可能在那里找不到任何答案.

The problem is, that you could theoretically dig into androids source code and change the screenshot behaviour. But with that you would create a new Android version on your own. As @Hassan Uddin stated. Running that on your phone would require you to dig deep into androids source code and possibly not find any answer there.

这篇关于如何从屏幕截图中排除叠加?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆