You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
672 B
27 lines
672 B
using System;
|
|
using System.Globalization;
|
|
|
|
namespace App.Converters
|
|
{
|
|
public class Base64ToImage : IValueConverter
|
|
{
|
|
public Base64ToImage()
|
|
{
|
|
|
|
}
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
var bytes = System.Convert.FromBase64String(value as string);
|
|
MemoryStream imageDecode = new MemoryStream(bytes);
|
|
return ImageSource.FromStream(() => imageDecode);
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|
|
|