标签:object bsp system string div row ring exce ret
字符串转byte[]
byte[] by = ConVert.FromBase64String(st);
//byte[] 转图片
class BinaryImageConverter : IValueConverter{
object IValueConverter.Convert( object value,Type targetType,object parameter,System.Globalization.CultureInfo culture )
{
if(value != null && value is byte[])
{
byte[] bytes = value as byte[];
MemoryStream stream = new MemoryStream( bytes );
BitmapImage image = new BitmapImage();
image.BeginInit();
image.StreamSource = stream;
image.EndInit();
return image;
}
return null; }
object IValueConverter.ConvertBack( object value,Type targetType,culture )
{
throw new Exception("该方法不能执行");
}
}
byte[] 转图片
标签:object bsp system string div row ring exce ret
原文地址:https://www.cnblogs.com/MZ-A/p/12119187.html