Example usage for android.graphics BitmapFactory decodeFile

List of usage examples for android.graphics BitmapFactory decodeFile

Introduction

In this page you can find the example usage for android.graphics BitmapFactory decodeFile.

Prototype

public static Bitmap decodeFile(String pathName) 

Source Link

Document

Decode a file path into a bitmap.

Usage

From source file:Main.java

public static int getBitmapHeight(String path, String fileName) {
    Bitmap bitmap = BitmapFactory.decodeFile(path + fileName);
    return bitmap == null ? 0 : bitmap.getHeight();
}

From source file:Main.java

private static Bitmap readBitmap(String imgPath) {
    try {/*from w w w. java2 s.c o m*/
        return BitmapFactory.decodeFile(imgPath);
    } catch (Exception e) {
        return null;
    }
}

From source file:Main.java

/** file to Bitmap**/
public static Bitmap getBitmapByFile(String pathName) {
    return BitmapFactory.decodeFile(pathName);
}

From source file:Main.java

public static void loadBitmapFitWindow(String path, int nWidth) {
    Bitmap bitmap = BitmapFactory.decodeFile(path);
    int width = bitmap.getWidth();

    if (width < nWidth) {

    }//from  w  w w.  j  a  va2  s . com

}

From source file:Main.java

public static Bitmap getBitmapFromSDCard(String locaUrl) {
    return BitmapFactory.decodeFile(getFile(locaUrl).getPath());
}

From source file:Main.java

public static Bitmap getBitmap(String path) {
    return BitmapFactory.decodeFile(path);
}

From source file:Main.java

public static BitmapDrawable loadDrawable(String path) {
    return new BitmapDrawable(BitmapFactory.decodeFile(path));
}

From source file:Main.java

static Bitmap get(File cache) {
    return BitmapFactory.decodeFile(cache.getAbsolutePath());
}

From source file:Main.java

public static Bitmap getPhotoFromSDCard(String path, String photoName) {
    Bitmap photoBitmap = BitmapFactory.decodeFile(path + "/" + photoName + ".png");
    if (photoBitmap == null) {
        return null;
    } else {/*  w  w  w .j a va  2s  .c  o m*/
        return photoBitmap;
    }
}

From source file:Main.java

public static Bitmap getBitmap(Context context, String picName) {
    Bitmap bitmap = BitmapFactory.decodeFile(context.getFilesDir().toString() + "/" + picName);
    return bitmap;
}