Here you can find the source of getBitmapFromAsset(Context context, String strName)
public static Bitmap getBitmapFromAsset(Context context, String strName)
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import java.io.IOException; import java.io.InputStream; public class Main { public static Bitmap getBitmapFromAsset(Context context, String strName) { AssetManager assetManager = context.getAssets(); InputStream istr;//from w ww . ja va 2 s . co m Bitmap bitmap = null; try { istr = assetManager.open(strName); bitmap = BitmapFactory.decodeStream(istr); } catch (IOException e) { return null; } return bitmap; } }