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.
29 lines
753 B
29 lines
753 B
using System;
|
|
using System.Globalization;
|
|
|
|
namespace League_of_legendes2.Utils
|
|
{
|
|
public class Base64ToImage:IValueConverter
|
|
{
|
|
public Base64ToImage()
|
|
{
|
|
}
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
string input = value as string;
|
|
byte[] decodedImg = System.Convert.FromBase64String(input);
|
|
Stream memoryStream = new MemoryStream(decodedImg);
|
|
ImageSource output = ImageSource.FromStream(() => memoryStream);
|
|
return output;
|
|
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|
|
|