Code example for BitmapFactory.Options

Methods: decodeFile

0
    // Decode image in background. 
    @Override 
    protected Bitmap doInBackground(String... params) {
        data = params[0];
         
        Options opts = new BitmapFactory.Options();
        opts.inSampleSize = 2;   // for 1/2 the image to be loaded
 
        Bitmap original = BitmapFactory.decodeFile(data, opts);
         
        Integer[] newSize = BitmapHelper.GetThumbnailSize(original, 100, 100);
       
        Bitmap thumb = Bitmap.createScaledBitmap (original,newSize[0], newSize[1], false);
         
       return thumb;
    } 
 
    // Once complete, see if ImageView is still around and set bitmap. 
    @Override 
    protected void onPostExecute(Bitmap bitmap) {
        if (imageViewReference != null && bitmap != null) {