简体   繁体   中英

Caching Bitmap Images

I am working with #Xamarin.Android# Application. I don't know how to cache Bitmap images. In Xamarin.Android Application how to cache data?

I'm going to recommend you look at this library

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

It is a Xamarin Binding for this Android Library

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

And it does everything you want in regards to caching images.

As for caching a byte[] in memory you can create PCL and use this code http://ranahossain.blogspot.co.uk/2014/01/cache-provider-for-portable-class.html

I recently had to write something to do this, and wasn't able to use the libraries mentioned by Adam because we needed to do some custom post processing of the images before they were cached etc.

I can't share the code I wrote, but I referred to this article heavily . In my case, we also had to load the images remotely before processing, so the prior article on that same site here was a lot a lot of help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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