MAUI CollectionView 显示缩略图而不是全尺寸照片。

huangapple go评论80阅读模式
英文:

MAUI CollectionView show Thumbnail instead full size photo

问题

我创建了一个用于显示应用程序自己捕获的特定照片的CollectionView。

当显示原始照片时,速度非常慢,例如5MB~10MB的大小可能太大了。

是否有任何方法可以获取甚至创建预览缩略图?

我尝试使用C#标准方式,但Image.Save(在MAUI中的MemoryStream)仅适用于Windows平台...

英文:

I created a Collection View for a app that showing photo specific by self app captured.

When showing the original photo it very slow e.g. the size of 5MB~10MB may be too large for showing.

Is there any way that I can get or even create the thumbnail for preview?

I tried for using C# standard way but the Image.Save( MemoryStream in MAUI is Windows platform only ...

答案1

得分: 0

首先,我想指出,这不是一个选择的问题。

过大的图像将无法呈现,您将看到的只是白色空间。(从在Android上测试中得出的结论。)

您可以首先检查这个链接:
https://learn.microsoft.com/en-us/dotnet/maui/user-interface/graphics/images?view=net-maui-7.0

我还使用ImageSharp。(尽管最近发生了一些荒谬的事情,但这仍然是一个非常好的工具)。

无论如何,也许最好将照片和缩略图分开存储,谈到集合视图,如果您需要大规模缩放5-10 MB的照片,我认为它可能性能不佳。至少我使用的设备不能有效地执行此操作。

英文:

First of all, I want to point out, that it is not a matter of choice.

Too big images will not be rendered, and you will see nothing but white space. (Learned that from testing it on Android.)

You can check this first:
https://learn.microsoft.com/en-us/dotnet/maui/user-interface/graphics/images?view=net-maui-7.0

I also use ImageSharp. (Despite the non-sense that happened recently, this is still a very good tool).

In any case, maybe it will be good to store the photo and the thumbnail separately, speaking of collection view, I do not think that it will perform well, if you need to mass-scale 5-10 MB photos. At least the devices I use cannot do this effectively.

huangapple
  • 本文由 发表于 2023年1月9日 14:16:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75053743.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定