1234567891011121314151617181920212223242526 |
- using Avalonia.Data.Converters;
- using Avalonia.Media.Imaging;
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace AvaloniaApplication1.Resources
- {
- internal class ImageConverter : IValueConverter
- {
- public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- if (value is byte[]) return new Bitmap(new MemoryStream((byte[])value));
- return null;
- }
- public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|