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:com.kabootar.GlassMemeGenerator.ImageOverlay.java

public static void main(String[] args) throws InterruptedException {

    try {/*from ww  w . j av  a  2  s .  c om*/
        if (new File(CAPTION_FILE).exists()) {
            new File(CAPTION_FILE).delete();
        }
        Bitmap image = BitmapFactory.decodeFile(INPUT_IMAGE);
        Canvas graphics = new Canvas(image);
        String captionTop = TOP_TEXT;
        String captionBottom = BOTTOM_TEXT;
        drawStringCentered(graphics, captionTop, image, true, null);
        drawStringCentered(graphics, captionBottom, image, false, null);

        //ImageIO.write(image, "png", new File(CAPTION_FILE));
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Main.java

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

From source file:Main.java

public static Bitmap openBitmap(String filepath) {
    return BitmapFactory.decodeFile(filepath);
}

From source file:Main.java

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

From source file:Main.java

public static Bitmap fileToBitmap(String fileName) {
    return BitmapFactory.decodeFile(fileName);
}

From source file:Main.java

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

From source file:Main.java

public static Bitmap getBitmap(String url) {
    Bitmap bitmap = BitmapFactory.decodeFile(url);
    return bitmap;
}

From source file:Main.java

public static Bitmap getBitmapByPath(String path) {
    Bitmap bitmap = BitmapFactory.decodeFile(path);
    return bitmap;

}

From source file:Main.java

public static Bitmap getConvertBitmap(String filepath) {
    Bitmap bitmap = BitmapFactory.decodeFile(filepath);
    return bitmap;
}

From source file:Main.java

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