get Thumbnail Image from Bitmap - Android android.graphics

Android examples for android.graphics:Image Load Save

Description

get Thumbnail Image from Bitmap

Demo Code

import java.io.File;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;

public class Main {

  protected static Bitmap getThumbnail(File f) {
    Options thumbOptions = new Options();
    thumbOptions.inSampleSize = 8;//from   w  w w .ja  v  a 2s .com

    return getImage(f, thumbOptions);
  }

  private static Bitmap getImage(File f, Options options) {
    Bitmap image = BitmapFactory.decodeFile(f.getAbsolutePath(), options);
    return image;
  }

}

Related Tutorials