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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -