简体   繁体   English

长图像在颤动中模糊。 扑

[英]Long Images are blurry in flutter. Flutter

My app is about reading manga.我的应用程序是关于阅读漫画的。 Some manga image are vertically long, like an inverted panorama image.一些漫画图像是垂直长的,就像倒置的全景图像。 The app displays these images blurred and low res although they are fine and high quality.该应用程序显示这些图像模糊和低分辨率,尽管它们很好且质量很高。 What could the reason be and what is the solution.原因可能是什么,解决方法是什么。 Another problem is that scrolling in these images downward is not smooth, they are put into a list view to display ads in between pages.Thank you in advance.另一个问题是这些图像向下滚动不流畅,它们被放入列表视图以在页面之间显示广告。提前谢谢您。

The image code is like this:图片代码是这样的:

ListView.builder(
    itemCount: imageUrls.length,
    itemBuilder: (context, index) {
      return Image.network(
        imageUrls[index],
        fit: BoxFit.fitWidth,
      );
    });

A very simple code.一个非常简单的代码。 Any help appreciated.任何帮助表示赞赏。

You can try it yourself, here is a link to an image and insert it in a listview with image.network.您可以自己尝试,这里有一个图像链接,并将其插入带有 image.network 的列表视图中。

download Link for a long image: https://ufile.io/gh59hu06长图下载链接: https : //ufile.io/gh59hu06

So i did some research and found out that flutter does not tile images in order to dovide them into smaller parts to make the job of image processing and display easier on the GPU.所以我做了一些研究,发现 flutter 不会平铺图像,以便将它们分成更小的部分,以便在 GPU 上更轻松地进行图像处理和显示工作。 The only way around this issue is to split images manually and display them divided.解决此问题的唯一方法是手动拆分图像并将它们分开显示。 You can use the image package in pub.dev to do the job.您可以使用 pub.dev 中的图像包来完成这项工作。 This is awfully a bad approach from the flutter devs, I made an issue at github and they added it as a feature request but of severe performance, wierd right!这对于 Flutter 开发者来说是一个非常糟糕的方法,我在 github 上提出了一个问题,他们将它添加为一个功能请求,但性能很差,很奇怪!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM