how to compress image for imageview in android

前端 未结 2 620
悲哀的现实
悲哀的现实 2020-12-12 06:32

Hi I want to show 3 or 4 image in my view that are stored in sdcard the size of images is 1-2 MB approximately. My problem is when I use image in imageview then it throw ou

2条回答
  •  执笔经年
    2020-12-12 07:33

    Create a BitmapFactory.Options and pass a value >1 in inSampleSize (preferably a power of 2) to scale the image down when loading it.

提交回复
热议问题