MemoryStream s = new MemoryStream();
Image img = Image.FromFile(file);
Graphics graphics = Graphics.FromImage(img);
graphics.FillRectangle(Brushes.White, new Rectangle(0, 0, img.Width, img.Height));
graphics.SmoothingMode = SmoothingMode.HighQuality;
int nlen = System.Text.Encoding.Default.GetByteCount(logo);
graphics.DrawString(logo, new Font("Arial", 52, GraphicsUnit.Pixel), Brushes.Black, new Point(x, y));
img.Save(s, img.RawFormat);
graphics.Dispose();
img.Dispose();
**FileStream fi = new FileStream(file, FileMode.Open, FileAccess.ReadWrite);
s.WriteTo(fi);
s.Close();
fi.Close();
带**的那行抛的异常.请高手指教.
Image img = Image.FromFile(file);
Graphics graphics = Graphics.FromImage(img);
graphics.FillRectangle(Brushes.White, new Rectangle(0, 0, img.Width, img.Height));
graphics.SmoothingMode = SmoothingMode.HighQuality;
int nlen = System.Text.Encoding.Default.GetByteCount(logo);
graphics.DrawString(logo, new Font("Arial", 52, GraphicsUnit.Pixel), Brushes.Black, new Point(x, y));
img.Save(s, img.RawFormat);
graphics.Dispose();
img.Dispose();
**FileStream fi = new FileStream(file, FileMode.Open, FileAccess.ReadWrite);
s.WriteTo(fi);
s.Close();
fi.Close();
带**的那行抛的异常.请高手指教.
Byte[] bytBLOBData = new Byte[s.Length];
s.Position = 0;
s.Read(bytBLOBData, 0, Convert.ToInt32(s.Length));
MemoryStream stmBLOBData = new MemoryStream(bytBLOBData);
pictureBox1.Image= Image.FromStream(stmBLOBData);