* 读取Assets文件夹中的图片资源
* @param context
* @param fileName 图片名称
* @return
*/
public static Bitmap getImageFromAssetsFile(Context context, String fileName) {
Bitmap image = null;
AssetManager am = context.getResources().getAssets();
try {
InputStream is = am.open(fileName);
image = BitmapFactory.decodeStream(is);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
return image;
}
Android 获取assets文件夹中的图片资源
最新推荐文章于 2024-05-22 09:56:05 发布