public static Bitmap readBitMap(Context context, int resId) {BitmapFactory.Options opt = new BitmapFactory.Options();opt.inPReferredConfig = Bitmap.Config.RGB_565;opt.inPurgeable = true;opt.inInputShareable = true;// 获取资源图片InputStream is = context.getResources().openRawResource(resId);return BitmapFactory.decodeStream(is, null, opt);}
最后再通过View.setImageBitmap 方法加载图片即可
新闻热点
疑难解答