Out of memory while creating bitmaps on device

前端 未结 2 969
执笔经年
执笔经年 2020-11-29 13:43

im having problems with high resolution images.

Im using nodpi-drawable folder for 1280x720 images, and using this code to scale it.

public static Dr         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 14:20

    You should use the utility class BitmapFactory for image-processing-operations. Also use BitmapFactory.Options to adjust the input/output sizes of the bitmaps. After a bitmap is not needed anymore, you should free the related memory.

提交回复
热议问题