/**
* 从Assets中读取图片
*/
public static Bitmap getImageFromAssetsFile(Context mContext,String fileName)
{
Bitmap image = null;
AssetManager am = mContext.getAssets();
try
{
InputStream is = am.open(fileName);
image = BitmapFactory.decodeStream(is);
is.close();
}
catch (IOException e)
{
e.printStackTrace();
}
return image;
}
两个参数,一个mContxt,上下文,另一个fileName,需要读取的图片的名称。