コード例 #1
0
 static public byte[] ImageToBufferPNG(Image image)
 {
     using (MemoryStream stream = new MemoryStream())
     {
         MInspect._SavePNG(image, stream);
         return(stream.ToArray());
     }
 }
コード例 #2
0
        static public string ImageToBase64PNG(Image image)
        {
            //stopwatch.Start();

            string binStr = Convert.ToBase64String(MInspect.ImageToBufferPNG(image));

            //stopwatch.Stop();

            return("data:image/png;base64," + binStr);
        }