public static byte[] ConvertStringToBytes(string input) { MemoryStream stream = new MemoryStream(); using (StreamWriter writer = new StreamWriter(stream)) { writer.Write(input); writer.Flush(); } return stream.ToArray(); }
public BitmapImage ByteArraytoBitmap(Byte[] byteArray) { MemoryStream stream = new MemoryStream(byteArray); byte[] bytes = byteArray as byte[]; BitmapImage image = new BitmapImage(); image.SetSource(stream); return image; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)