public object ConvertImageInArrayByte( object value, Type targetType, object parameter, CultureInfo culture )
{
ImageSource retSource = null;
if (value != null)
{
byte[] imageAsBytes = (byte[])value;
retSource = ImageSource.FromStream(() => new MemoryStream(imageAsBytes));
}
return retSource;
}
The image is loaded in xaml:
<Image x:Name="fotosOcorrencia" HorizontalOptions="Center" Source="{Binding Foto}" HeightRequest="180"/>
But I do not know how to fill in the parameters, I did not find one or the other to do that. I'm trying to do this:
arrayByteImagem = ConvertImageInArrayByte(fotosOcorrencia, CultureInfo.CurrentCulture);
I'm very grateful that someone can help me, I know it's not difficult, but I can not find the solution.