Android : Retrieving the bitmap of a hardware-accelerated Android View

on Friday, September 5, 2014


Is there any way of retrieving the actual pixel data/bitmap as rendered onto a hardware-accelerated View (or possibly Canvas)?


There appears to be plenty of ways of re-rendering the same thing in software and then getting the pixels, but no way of actually getting the bitmap data rendered with hardware-acceleration. For example by using View's drawing cache you seem to get a software-rendered version.


On the other hand, Canvas.setBitmap() only works with non-hardware-accelerated canvases. Canvas.saveLayer() talks about saving to an offscreen bitmap, but I have found no way of retrieving this bitmap.


0 comments:

Post a Comment