jeudi 16 avril 2015

The memory of Bitmap decode


Vote count:

0




I have some questions about Bitmap decode.




  1. When I try to decode Bitmap from a byte[] array, using BitmapFactory.decodeByteArray, what is the difference between the param byte[] and the mBuffer byte[] in result bitmap. when the function return will the bitmap still hold reference to the byte[] param?




  2. when I decode bitmap from a jpg file from sdcard using the following code:


    File file = new File(getExternalCacheDir(), "large.jpg"); bitmap = BitmapFactory.decodeFile(file.getAbsolutePath());


    if(mImageView != null){ mImageView.setImageBitmap(bitmap); }


    It works very well. This jpg file has 10800*5400 resolution and 13.82M size, the result bitmap is null, and there is no OOM error , but the bitmap not showing. How could that be ?





asked 2 mins ago







The memory of Bitmap decode

Aucun commentaire:

Enregistrer un commentaire