我正在尝试在加载应用程序主数据时在后台加载、调整大小和转换图像。我需要这样做,因为有些图像太大而且我有很多,所以,我认为最好在展示之前准备好所有图像。
我在后台执行此代码:从 Uri 加载图像:
ImageService.Instance.LoadUrl(uri, TimeSpan.FromDays(60))
.DownSample(100, 100, false).Preload();
加载相同的图像并对其应用额外的转换:
ImageService.Instance.LoadUrl(uri, TimeSpan.FromDays(60))
.DownSample(100, 100, false).Transform(BlurredTransformHere).Preload();
以后如何在 CachedImage 中重用这些缓存查询的结果?
<forms:CachedImage
x:Name="Blured"
Aspect="Fill"
CacheType="All"
HorizontalOptions="Fill"
Opacity="0.3"
VerticalOptions="Fill"/>
<forms:CachedImage
x:Name="Normal"
CacheType="All"
Aspect="AspectFit"
HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand"/>
我应该为每个 CachedImage 添加与查询中相同的配置参数吗?例如添加具有相同参数值的 DownsampleHeight&W 和 BlurredTransformation?