日期:2014-05-18 浏览次数:21229 次
using (MemoryStream stream = new MemoryStream()) { PictureBox pb = c as PictureBox; pb.Image.Save(stream, ImageFormat.Jpeg); byte[] by = stream.ToArray(); string s = System.Convert.ToBase64String(by); }
PictureBox pb = new PictureBox(); byte[] b = System.Convert.FromBase64String(xnChild.Attributes["Image"].InnerText); using (MemoryStream ms = new MemoryStream(b)) { Image myimge = Image.FromStream(ms); pb.Image = myimge; pb.BorderStyle = BorderStyle.FixedSingle; pb.SizeMode = PictureBoxSizeMode.StretchImage; }