コード例 #1
4
 public byte[] ImageToByteArray(Avalonia.Media.Imaging.Bitmap image)
 {
     using (MemoryStream stream = new MemoryStream())
     {
         image.Save(stream);
         return(stream.ToArray());
     }
 }
コード例 #2
4
 public static Bitmap ToSystemBitmap(this Avalonia.Media.Imaging.Bitmap bitmap)
 {
     using var memoryStream = new MemoryStream();
     bitmap.Save(memoryStream);
     return(new Bitmap(memoryStream));
 }