// 可用于生成缩略图。 /** * Creates a centered bitmap of the desired size. Recycles the input. * * @param source */ public static Bitmap extractMiniThumb(Bitmap source, int width, int height) { return extractMiniThumb(source, width, height, true); } public static Bitmap extractMiniThumb(Bitmap source, int width, int height, boolean recycle) { if (source == null) { return null; } float scale; if (source.getWidth() < source.getHeight()) { scale = width
Android图片操作-生成缩略图
最新推荐文章于 2022-01-22 19:10:23 发布
本文详细介绍了在Android平台中如何高效地生成图片缩略图,包括使用Bitmap.createScaledBitmap()方法和 BitmapFactory.Options 的 inSampleSize 属性进行内存优化,确保在不消耗过多资源的情况下实现图片的快速预览。
摘要由CSDN通过智能技术生成