我无法显示表单字节数组中的图像。
xaml代码:
<StackLayout VerticalOptions="FillAndExpand" Padding="20, 10" Spacing="10" >
<Image Source="{Binding ScannedImage}"/>
</StackLayout>
View Model:
public void HandleImagereceived(object sender, byte[] byteImage)
{
var image = ImageSource.FromStream(() => new MemoryStream(byteImage));
ScannedImage = image
}
public ImageSource ScannedImage
{
get { return scannedImage; }
set
{
scannedImage = value;
OnPropertyChanged("ScannedImage");
}
}