Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.koushikdutta.ion;
 
 import  android.graphics.Bitmap;
 import  android.graphics.BitmapRegionDecoder;
 import  android.graphics.Point;
 import  android.graphics.Rect;
 
Created by koush on 1/29/14.
public class LoadBitmapRegion extends BitmapCallback {
    public LoadBitmapRegion(final Ion ionfinal String keyfinal BitmapRegionDecoder decoderfinal Rect regionfinal int inSampleSize) {
        super(ionkeytrue);
        Ion.getBitmapLoadExecutorService().execute(new Runnable() {
            @Override
            public void run() {
                try {
                    Bitmap bitmap = IonBitmapCache.loadRegion(decoderregioninSampleSize);
                    if (bitmap == null)
                        throw new Exception("failed to load bitmap region");
                    BitmapInfo info = new BitmapInfo(keynullnew Bitmap[] { bitmap }, new Point(bitmap.getWidth(), bitmap.getHeight()));
                    report(nullinfo);
                }
                catch (Exception e) {
                    report(enull);
                }
            }
        });
    }
New to GrepCode? Check out our FAQ X