Search code examples
androidconsolescreenshotsuperuser

Screenshot from background and process it before save


is it possible to make an screenshot of another app from background and convert it to Bitmap to make some changes before save? device is rooted.

i've tried perform console command but it automatically saves file to disk, so i need than read file, make changes (show to user) and save it again (or remove). so, want to avoid first saving.

btw, is it possible to screen only specific area, not full screen?


Solution

  • If you can make a system app (a app that is signed with the same key as your Android System) then you can use a WindowManagerService.java API screenshotApplications() which returns a Bitmap of the screenshot.

    For more details please go through WindowManagerService.java source