Efficient "screenshots" Of A View?
TL;DR: Since getDrawingCache() seems to trigger a complete redraw of a View when hardware acceleration is enabled, is there an alternative means of getting a Bitmap (or something a
Solution 1:
You can use setLayerType(View.LAYER_TYPE_SOFTWARE, null)
but it will have the side effect of making that View slower to redraw every time it updates. It would be much more efficient to create a custom ViewGroup
that draws your View on two Canvas (one for each screen.) You could also simply use a ViewTreeObserver
and on every draw callback force your view to render on the second screen. I really recommend you don't try to abuse the drawing cache/layer type for such a use case.
Post a Comment for "Efficient "screenshots" Of A View?"