缓存位图图像

时间:2015-08-01 02:51:44

标签: android caching xamarin

我正在使用#Xamarin.Android #Application。我不知道如何缓存位图图像。在Xamarin.Android应用程序中如何缓存数据?

2 个答案:

答案 0 :(得分:0)

我建议你看看这个图书馆

https://github.com/LukeForder/Xamarin-Bindings-Android-Universal-Image-Loader

这是这个Android库的Xamarin绑定

https://github.com/nostra13/Android-Universal-Image-Loader

它可以完成缓存图像所需的一切。

至于在内存中缓存byte [],您可以创建PCL并使用此代码 http://ranahossain.blogspot.co.uk/2014/01/cache-provider-for-portable-class.html

答案 1 :(得分:0)

我最近不得不写一些东西来做这件事,并且无法使用Adam提到的库,因为我们需要在缓存等之前对图像进行一些自定义的后期处理。

我无法分享我写的代码,但我提到了this article 。在我的情况下,我们还必须在处理之前远程加载图像,因此同一网站here上的先前文章提供了很多帮助。