Is it possible to capture only a part of the screen, or even of a particular view of another app?

只谈情不闲聊 提交于 2019-12-09 21:41:50

问题


Android allows to capture a full screen into an image or a video, using the MediaProjection class (shown here for example for images).

I was wondering how far can we go with this :

  1. Is it possible to capture only a specific area of the screen?

  2. Is it possible to capture an image of a specific view of another app ?

  3. Is it possible to get the bitmap of an ImageView of another app (the one that's saved using setImageBitmap, for example) ?


回答1:


No, no and no. This API basically gives you access to a copy of the hardware screen buffer. You can manipulate its contents, but you get only a full screen bitmap. There's no way to get any specific view or a class from another app. I imagine that that would be a major security flaw it it was possible.



来源:https://stackoverflow.com/questions/41539245/is-it-possible-to-capture-only-a-part-of-the-screen-or-even-of-a-particular-vie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!