In WinRT / C#, How do I download an image to a local folder to support caching of an online catalogue for offline use? is there a way to directly download the images and link the control to get them from the cache as a fallback?
var downloadedimage = await HttpWebRequest.Create(url).GetResponseAsync();
StorageFile imgfile = await ApplicationData.Current.LocalFolder.CreateFileAsync(
"localfile.png", CreationCollisionOption.FailIfExists);
What do I do next to store downloadedimage as localfile.jpg?
Looks like the code below from the HttpClient sample for Windows 8 solves the issue
httpClient is a HttpClient, and its BaseAddress needs to be set a the server folder of your resource. we can then do this to convert that to an image source (if that’s what we’re downloading)
or this to write it to file