Fresco SimpleDrawee查看像素化图像 [英] Fresco SimpleDraweeView pixelated image

查看:200
本文介绍了Fresco SimpleDrawee查看像素化图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SimpleDraweeView正在从外部存储器加载像素化的位图图像。

SimpleDraweeView is loading a pixelated bitmap image from the external storage.

我正在从assets文件夹复制图像通过此

I am copying the image from assets folder to the external storage through this

private OutputStream copy(InputStream in, OutputStream out) throws IOException{
    // Transfer bytes from in to out
    byte[] buf = new byte[in.available()];
    int len;
    while ((len = in.read(buf)) > 0) {
        out.write(buf, 0, len);
    }
    in.close();
    out.close();
    return out;
}

然后我通过此

Fresco.getImagePipeline().evictFromMemoryCache(uri);
    Fresco.getImagePipelineFactory().getMainDiskStorageCache().remove(new SimpleCacheKey(uri.toString()));
    Fresco.getImagePipelineFactory().getSmallImageDiskStorageCache().remove(new SimpleCacheKey(uri.toString()));

    Postprocessor postprocessor = new BasePostprocessor() {
        @Override
        public void process(Bitmap bitmap) {

            });
        }
    };

    ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri)
            .setPostprocessor(postprocessor)
            .build();

    PipelineDraweeController controller = (PipelineDraweeController)
            Fresco.newDraweeControllerBuilder()
                    .setImageRequest(request)
                    .setOldController(header.getController())
                    .build();

    header.setController(controller);


推荐答案

这是一个已知错误。它在Fresco 0.9.0中修复。如果您仍然遇到此问题,请再试一次并打开一个新的GitHub问题。

This was a known bug. It was fixed in Fresco 0.9.0. Please try again and open a new GitHub issue if you are still experiencing this.

这篇关于Fresco SimpleDrawee查看像素化图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆