Hey, if all else fails for you, this is an easy way to make your own thumbnail if you have a bitmap. If you do not know how to download Bitmap from Uri:
Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), imageUri);
Here is the code to make a beautiful formatted sketch:
final int THUMBNAIL_HEIGHT = 75;//48 final int THUMBNAIL_WIDTH = 75;//66 Float width = new Float(bitmap.getWidth()); Float height = new Float(bitmap.getHeight()); Float ratio = width/height; bitmap = Bitmap.createScaledBitmap(bitmap, (int)(THUMBNAIL_HEIGHT*ratio), THUMBNAIL_HEIGHT, false); int padding = (THUMBNAIL_WIDTH - bitmap.getWidth())/2; image.setPadding(padding, padding, padding, padding); image.setBackgroundColor(0); image.setImageBitmap(bitmap);
In this code, "image" is a variable for ImageView. Hope this helps some: D
Cheney hester
source share