问题
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 :
Is it possible to capture only a specific area of the screen?
Is it possible to capture an image of a specific view of another app ?
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