I need Thumbnail of an image . I only know about the name of image which is stored in SD card . Can anyone help me.
Try this. final int THUMBSIZE = 64; Bitmap ThumbImage = ThumbnailUtils. extractThumbnail(BitmapFactory. decodeFile(imagePath), THUMBSIZE, THUMBSIZE);
Thumbnails are minuscule replicas of the images stored in your phone. These smaller versions of your actual images are automatically created by your gallery app and enable you to see small representations of your image in the digital gallery or album.
This works for me: Bitmap thumb = ThumbnailUtils. createVideoThumbnail(filePath, Thumbnails. MINI_KIND);
Try this.
final int THUMBSIZE = 64;
Bitmap ThumbImage = ThumbnailUtils.extractThumbnail(BitmapFactory.decodeFile(imagePath),
THUMBSIZE, THUMBSIZE);
Refer this for more details.
Using MediaStore.Images.Thumbnails
you can query and get two kinds of thumbnails: MINI_KIND: 512 x 384 thumbnail MICRO_KIND: 96 x 96 thumbnail.
The advantage of using this call is that the thumbnails are cached by the MediaStore. So retrieval would be faster if the thumbnail was previously created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With