get Local Bitmap - Android android.graphics

Android examples for android.graphics:Bitmap Load Save

Description

get Local Bitmap

Demo Code

import java.io.FileInputStream;
import java.io.FileNotFoundException;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Main {

  public static Bitmap getLocalBitmap(String url) {
    try {/*from   w w  w.  ja v  a  2 s. c o  m*/
      FileInputStream fis = new FileInputStream(url);
      return BitmapFactory.decodeStream(fis);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      return null;
    }
  }

}

Related Tutorials