编程语言
首页 > 编程语言> > C# convert between Image and Base64string

C# convert between Image and Base64string

作者:互联网

 static void ImageMSDemo(string picPath)
        {            byte[] imageArray = System.IO.File.ReadAllBytes(picPath);
            string base64ImageRepresentation = Convert.ToBase64String(imageArray);
            var img = Image.FromStream(new MemoryStream(Convert.FromBase64String(base64ImageRepresentation)));
            img.Save("newImg.jpg");
        }

 

标签:imageArray,convert,string,img,C#,Image,Convert,picPath,Base64string
来源: https://www.cnblogs.com/Fred1987/p/11754372.html