只是为了记下来,怕以后忘了。
int width =100;//目标宽度
Postprocessor postprocessor = new Postprocessor() {
@Override public CloseableReference<Bitmap> process(Bitmap sourceBitmap, PlatformBitmapFactory bitmapFactory) {
int sw = sourceBitmap.getWidth();
int sh = sourceBitmap.getHeight();
float scale = (float) width / (float) sw;
int mscale = sw / width;
float heigh = scale * (float) sh;
int nscale = sh / (int) heigh;
CloseableReference<Bitmap> bitmapRef = bitmapFactory.createBitmap( width, (int) heigh);

这篇博客主要记录了如何使用Fresco库加载本地路径的图片,并详细介绍了如何在加载过程中修改图片的显示尺寸,以适应不同的场景需求,防止内存溢出。
最低0.47元/天 解锁文章
3513

被折叠的 条评论
为什么被折叠?



