getting Image ThumbNail in Android

前端 未结 4 1477
北荒
北荒 2020-12-28 08:52

I need Thumbnail of an image . I only know about the name of image which is stored in SD card . Can anyone help me.

4条回答
  •  [愿得一人]
    2020-12-28 09:15

    If you like HQ thumbnails, so use [RapidDecoder][1] library. It is simple as follow:

    import rapid.decoder.BitmapDecoder;
    ...
    Bitmap bitmap = BitmapDecoder.from(getResources(), R.drawable.image)
                                 .scale(width, height)
                                 .useBuiltInDecoder(true)
                                 .decode();
    

    Don't forget to use builtin decoder if you want to scale down less than 50% and a HQ result.

提交回复
热议问题