从Assets中读取图片

/**
	 * 从Assets读取图片
	 * @param 文件名字
	 * @return Bitmap
	 */
	private Bitmap getImageFromAssetsFile(String fileName) {
		Bitmap image = null;
		AssetManager am = getResources().getAssets();
		try {
			InputStream is = am.open(fileName);
			image = BitmapFactory.decodeStream(is);
			is.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return image;
	}


 

你可能感兴趣的:(从Assets中读取图片)