如何到Base64 PNG图像串为PNG格式转换成C#
问题描述:
可能重复:
converting a base 64 string to an image and saving it如何到Base64 PNG图像串为PNG格式转换成C#
我有编码为Base64编码字符串PNG图像。我需要将此字符串转换为PNG格式。我怎样才能在C#中进行转换?
答
byte[] data = Convert.FromBase64String(base64String);
using(var stream = new MemoryStream(data, 0, data.Length))
{
Image image = Image.FromStream(stream);
//TODO: do something with image
}
非常好,谢谢。 – user960567 2012-07-13 04:58:47