Recycle ImageView's Bitmap

后端 未结 4 754
谎友^
谎友^ 2020-11-27 14:06

I have something like this:

Bitmap.Config conf = Bitmap.Config.ARGB_8888;
WeakReference bm = new WeakReference(Bitmap.createBitma         


        
4条回答
  •  野性不改
    2020-11-27 14:21

    Don't create images larger than you need at any one time. The heap limitations are designed to prevent you from hanging yourself and completely taking over the device's limited memory.

    If you need more detail because you plan on zooming in, then re-render that portion of the image with higher detail at zoom time, excluding the portions you aren't viewing.

提交回复
热议问题