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; opt.inJustDecodeBounds = false; int be = opt.outHeight / 20; if (be % 10 != 0) be += 10; be = be / 10; if (be <= 0) be = 1; opt.inSampleSize = be; InputStream is = context.getResources().openRawResource(resId); return BitmapFactory.decodeStream(is, null, opt); }
Android 缩略图
最新推荐文章于 2021-05-27 07:13:40 发布