getImageBitmap方法, 传入R.drawable.* 取

public  static Bitmap getImageBitmap(int resourImage,Context context) {
InputStream is = context.getResources().openRawResource(resourImage);
Bitmap bitmap = BitmapFactory.decodeStream(is);
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
return bitmap;
}

你可能感兴趣的:(getImageBitmap方法, 传入R.drawable.* 取)