java - How to do a screen capture without getting an OOM (out of memory) exception? -
i want screencapture , save view.
i think can create bitmap big view , draw view on bitmap. in situation, view's width same screen's width, , height may more screen.
so easy oom problem. there way avoid problem?
if don't need transparency, can use bitmap.config.rgb_565
instead of bitmap.config.argb_8888
:
bitmap.createbitmap(width, height, bitmap.config.rgb_565);
this reduces memory usage half.
Comments
Post a Comment