I'm writing a Windows Phone 7 app that deals with a lot of images - These images can range from a few hundred pixels up to 1080P (Potentially higher in future).
Images are very resource intensive so I've gone down the path of caching + resizing images on the phone before displaying them.
This means on first time setup after a user has entered the IP address of the image store I can ask them to wait a few minutes while it's all retrieved/resized/cached. From then on they can have nice and snappy performance.
At the moment my cache manager tracks Images by a dictionary of Uri's and file locations. I have a Queue that processes up to 5 images at a time (Async web requests, resizing is semi done on thread pool thread).
The problem I have is that the WritableBitmap class in Silverlight is a UI element, meaning I have to transition to the UI thread via the Dispatcher to do the actual resizing which is stupid and slows the whole thing down - It also means my Cache Manager is effectively single threaded.
So it goes Cache Manager (Thread Pool) -> Async Web request (Thread Pool) -> Callback (Thread Pool) -> Resizing (UI Thread) -> Marking cache job as complete (Thread Pool).
I've been looking for a 3rd party library that will A) Compile and run on Windows Phone 7 and B) Be able to resize images of various formats by manipulating a stream or byte array and not be dependent on the UI thread.
Any one had any experience with this?
Cheers,
Tyler
In order to reduce the download size and in order to remove the burden of processing from the phone CPU, then I'd push this work out to a web service.
For example, you could host a service like the open source WebImageResizer code somewhere online http://webimageresizer.codeplex.com/ - e.g. on a free AppHarbor server.
Or you could use a commercial (freemium) service like:
Either of these would enable you to rapidly process the images on a server with a superfast connection and to juse deliver smaller images to the phone with its limited data connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With