0

I'm trying to solve a finger occlusion problem by having on touch events clone the covered section of the screen to an imageview. I am pulling the image from /dev/graphics/fb0 and cropping the image based on touch events.

Runtime.getRuntime().exec("cat /dev/graphics/fb0 > /dev/rawFrame.raw");

gets and writes the image from fb0
then I run into the trouble of converting it such that I can put it in an ImageView.
Is the best way to go about this using bitmaps? Is this a good approach or have I missed the mark outright?

EDIT: is this the right way to pull a screenshot, I've heard that encoding the image is system dependant and this seems a bit hacky, if you know a better way I'm all ears.

Roadblock
  • 1
  • 1

1 Answers1

0

If you are using Android version > 4.0, you might use screencap or screenshot utility or the framework api Surface.screenshot() instead (You should have right permissions to do it). Or you can still use command "dd" to dump the framebuffer.

Robin
  • 10,052
  • 6
  • 31
  • 52