怎么将一个Image存为一个本地文件
我将数据库中的Image对象已经读出来了,想存为一个本地的文件,比如c:\a.jpg
怎么做呢
byte[] mydata = ((byte[])drData[ "BodyImage "]);
MemoryStream myStream = new MemoryStream();
foreach (byte a in mydata)
{
myStream.WriteByte(a);
}
Image myImage = Image.FromStream(myStream);
------解决方案--------------------myImage.Save(@ "d:\a.bmp ", System.Drawing.Imaging.ImageFormat.Bmp);