static public byte[] ImageToBufferPNG(Image image) { using (MemoryStream stream = new MemoryStream()) { MInspect._SavePNG(image, stream); return(stream.ToArray()); } }
static public string ImageToBase64PNG(Image image) { //stopwatch.Start(); string binStr = Convert.ToBase64String(MInspect.ImageToBufferPNG(image)); //stopwatch.Stop(); return("data:image/png;base64," + binStr); }