get Bitmap From Path - Android android.graphics

Android examples for android.graphics:BitmapFactory

Description

get Bitmap From Path

Demo Code

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.lemon.assist.Check;
import android.lemon.config.BaseConfig;
import android.os.Environment;
import android.os.StatFs;

public class Main{
    public static Bitmap getBitmapFromSrc(String src) {
        Bitmap bit = null;//  ww  w . jav  a2s  .  com
        try {
            bit = BitmapFactory.decodeStream(Main.class
                    .getResourceAsStream(src));
        } catch (Exception e) {
            Log.d(FileUtil.class, e.getMessage());
        }
        return bit;
    }

}

Related Tutorials