Im trying to load a file of type .ICO from web and use it as an image in my windows phone. But I get an error when trying to set the source of the BitmapImage. Here is my code:
WebClient client = new WebClient();
client.OpenReadCompleted += (s, e) => {
if (e.Cancelled) return;
if (null != e.Error) throw e.Error;
BitmapImage image = new BitmapImage();
image.SetSource(e.Result);
this.Favicon = image;
};
client.OpenReadAsync(new Uri(@"http://mysite/myimage.ico", UriKind.RelativeOrAbsolute));
Does BitmapImage support "ico" files? how to convert an "ico" to a supported BitmapImage file.
THe solution must work on Windows Phone 7.
Tks