- bgimg0 = getImageFromAssetsFile("Cat_Blink/cat_blink0000.png");
- *
- * 从Assets中读取图片
- */
- 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;
- }
Android 读取Assets中图片
最新推荐文章于 2024-06-28 16:19:12 发布