How to create a Drawable from a stream without resizing it?

前端 未结 3 1651
梦谈多话
梦谈多话 2020-12-05 16:18

If I have the minimum target SDK for my app set to 4 then all calls to Drawable.createFromStream resize images.

e.g. if the source image is 480px wide and the Androi

3条回答
  •  既然无缘
    2020-12-05 16:35

    You can load image as Bitmap. This way its size will be unchanged.

    BitmapFactory.decodeStream(...)
    

    Or you can try BitmapDrawable(InputStream is) constructor. It is deprecated but I guess it should do the job.

提交回复
热议问题