Java tutorial
//package com.java2s; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import java.io.InputStream; public class Main { private static Bitmap decodeBitmapStream(InputStream is) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ALPHA_8; return BitmapFactory.decodeStream(is, null, options); } }