Android 读取assets里的图片
时间:2014-10-21 11:36:31
收藏:0
阅读:361
1 Bitmap btimg = getImageFromAssetsFile("image/ic_launcher.png"); 2 3 private Bitmap getImageFromAssetsFile(String fileName) 4 { 5 Bitmap image = null; 6 AssetManager am = getResources().getAssets(); 7 try 8 { 9 InputStream is = am.open(fileName); 10 image = BitmapFactory.decodeStream(is); 11 is.close(); 12 } 13 catch (IOException e) 14 { 15 e.printStackTrace(); 16 } 17 return image; 18 }
原文:http://www.cnblogs.com/jiuqing/p/4039693.html
评论(0)