using var m = new MemoryStream();image.Save(memoryStream, ImageFormat.Png);return m.ToArray();
System.IO.File.WriteAllBytes
ImageBytes = Utils.GetGraphic(path);
<Image Source="{Binding ImageBytes}"/>
Bitmap
public static byte[] GetGraphic(string path) { using var m = new MemoryStream(); var image = System.Drawing.Image.FromFile(path); image.Save(m, image.RawFormat); return m.ToArray();}