1. 图片放在sdcard中,
Bitmap imageBitmap = BitmapFactory.decodeFile(path) // (path 是图片的路径,跟目录是/sdcard)
2.图片放在src目录下
String path = "com/xiangmu/test.png"; //图片存放的路径InputStream is = getClassLoader().getResourceAsStream(path); //得到图片流
注:LGame中使用了2方法。
1. 图片放在sdcard中,
Bitmap imageBitmap = BitmapFactory.decodeFile(path) // (path 是图片的路径,跟目录是/sdcard)
2.图片放在src目录下
String path = "com/xiangmu/test.png"; //图片存放的路径InputStream is = getClassLoader().getResourceAsStream(path); //得到图片流
注:LGame中使用了2方法。