Example usage for android.graphics BitmapFactory decodeStream

List of usage examples for android.graphics BitmapFactory decodeStream

Introduction

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

Prototype

public static Bitmap decodeStream(InputStream is) 

Source Link

Document

Decode an input stream into a bitmap.

Usage

From source file:Main.java

public static Bitmap inputStream2Bitmap(InputStream is) {
    return BitmapFactory.decodeStream(is);
}

From source file:Main.java

public static Bitmap InputStream2Bitmap(InputStream is) {
    return BitmapFactory.decodeStream(is);
}

From source file:Main.java

public static Bitmap inputStreamToBitmap(InputStream stream) {
    return BitmapFactory.decodeStream(stream);
}

From source file:Main.java

public static Bitmap loadFromBytes(byte[] bytes) {
    ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
    return BitmapFactory.decodeStream(inputStream);
}

From source file:Main.java

public static Bitmap inputStreamToBitmap(InputStream inputStream) throws Exception {
    return BitmapFactory.decodeStream(inputStream);
}

From source file:Main.java

public static Bitmap Stram2Bitmap(InputStream is) {
    if (is != null) {
        return BitmapFactory.decodeStream(is);
    } else {// w ww  . j  a v  a  2s.  c o  m
        return null;
    }
}

From source file:Main.java

public static Bitmap decodeInputStream(InputStream stream) {
    return BitmapFactory.decodeStream(stream);
}

From source file:Main.java

public static Bitmap scaleToStretchBitmap(Bitmap dst, InputStream is) {
    Bitmap src = BitmapFactory.decodeStream(is);

    return Bitmap.createScaledBitmap(src, dst.getWidth(), dst.getHeight(), true);
}

From source file:Main.java

public static Bitmap decodeBitmap(InputStream in) {
    Bitmap bitmap = null;/*from  w  w w.  jav  a 2s  . c  o  m*/
    try {
        bitmap = BitmapFactory.decodeStream(in);
    } catch (Exception e) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inSampleSize = 2;
        bitmap = BitmapFactory.decodeStream(in, null, options);

    }

    return bitmap;

}

From source file:Main.java

public static Bitmap getLoacalBitmap(String url) {
    try {/* w  w w  .  j  a va  2 s . c  om*/
        java.io.FileInputStream fis = new java.io.FileInputStream(url);
        return BitmapFactory.decodeStream(fis);
    } catch (java.io.FileNotFoundException e) {
        e.printStackTrace();
        return null;
    }
}