尝试这个
using (Image image = Image.FromFile(Path)){ using (MemoryStream m = new MemoryStream()) { image.Save(m, image.RawFormat); byte[] imageBytes = m.ToArray(); // Convert byte[] to base64 String string base64String = Convert.Tobase64String(imageBytes); return base64String; }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)