Android how to create runtime thumbnail

后端 未结 9 970
别那么骄傲
别那么骄傲 2020-11-27 09:59

I have a large sized image. At runtime, I want to read the image from storage and scale it so that its weight and size gets reduced and I can use it as a thumbnail. When a u

9条回答
  •  Happy的楠姐
    2020-11-27 10:42

    Try this

    Bitmap ThumbImage = ThumbnailUtils.extractThumbnail(BitmapFactory.decodeFile(imagePath), THUMBSIZE, THUMBSIZE);
    

    This Utility is available from API_LEVEl 8. [Source]

提交回复
热议问题