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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -