获取drawable目录下的资源
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),R.drawable.icon_1);
获取assets下的资源
Bitmap bitmap=null;
try {
InputStream is = mContext.getAssets().open("bitmap.png");
bitmap = BitmapFactory.decodeStream(is);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
其他方法略