Android Bitmap Create getBitMapFromStream(String filename)

Here you can find the source of getBitMapFromStream(String filename)

Description

get Bit Map From Stream

Declaration

public static Bitmap getBitMapFromStream(String filename) 

Method Source Code

//package com.java2s;

import android.graphics.Bitmap;

import android.graphics.BitmapFactory;

public class Main {
    public static Bitmap getBitMapFromStream(String filename) {
        Bitmap bitmap = null;//w  w  w .  j a va 2 s. com
        try {
            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inJustDecodeBounds = false;
            bitmap = BitmapFactory.decodeFile(filename, options);

            System.gc();
            return bitmap;

        } catch (Exception ex) {
            return null;
        }
    }
}

Related

  1. decodeSampledBitmapFromResource(Resources res, int resId, int reqWidth, int reqHeight)
  2. getBitmap(Context context, InputStream inputStream)
  3. getImage(String absPath)
  4. createCompatibleImage(int width, int height)
  5. createCompatibleImage(BufferedImage image, int width, int height)
  6. getBitmap(int resId, Context ctx)
  7. getBitmapFromImageView(ImageView theImage)
  8. getBitmapFromResource(Resources resources, int resourceId, int reqWidth, int reqHeight)
  9. getBitmapFromURI(Context context, Uri uri)