如何将Bitmap对象转换成字符串

2025-03-19 15:27:05
推荐回答(1个)
回答1:

Bitmap bmp = new Bitmap(@"d:\a.jpg");
System.IO.MemoryStream ms = new System.IO.MemoryStream();
bmp.Save(ms, bmp.RawFormat);
string 字符串 = System.Convert.ToBase64String(ms.ToArray());