Hi,
I'm having trouble binding ImageSource with Android, If we consider following code:
// Download image in custom format from internet
var image = await _httpClient.GetMainThumbnail((long)id);
// Convert to a byte stream
var bytes = Convert.FromBase64String(image.Image);
var stream = new MemoryStream(bytes, 0, bytes.Length);
stream.Write(bytes, 0, bytes.Length);
MainImageSource = ImageSource.FromStream(() => stream);
The MainImageSource
is a property in my viewmodel of type ImageSource
which is binded in code to an Image
imageView.SetBinding(Image.SourceProperty, "MainImageSource");
In Windows Phone this work flawless, in Android the image stay empty but the ImageSource is correctly loaded.
The only error I see in the VS Debug Console is:
08-06 14:06:55.866 D/skia ( 2731): --- SkImageDecoder::Factory returned null
Unfortunately I could't try with iOS yet.
Any help?
Using Xamarin.Forms version 1.2.2.6243
Thanks