Ejemplo n.º 1
0
 private string ImageToBase64(Avalonia.Media.Imaging.Bitmap image)
 {
     using (MemoryStream stream = new MemoryStream())
     {
         image.Save(stream);
         return(Convert.ToBase64String(stream.ToArray()));
     }
 }
Ejemplo n.º 2
0
 public byte[] ImageToByteArray(Avalonia.Media.Imaging.Bitmap image)
 {
     using (MemoryStream stream = new MemoryStream())
     {
         image.Save(stream);
         return(stream.ToArray());
     }
 }
Ejemplo n.º 3
0
 public static System.Drawing.Image ToDrawingImage(this Avalonia.Media.Imaging.Bitmap bmp)
 {
     System.Drawing.Image ret;
     using (MemoryStream stream = new MemoryStream())
     {
         bmp.Save(stream);
         ret = System.Drawing.Image.FromStream(stream);
     }
     return(ret);
 }