首页 > 代码库 > Android 读取assets里的图片

Android 读取assets里的图片

 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       }  

 

Android 读取assets里的图片