|
If a bitmap has been drawn
Stream s = new MemoryStream ();
bitmap.Save (s, ImageFormat.Jpeg);
using (FileStream fs = new FileStream (Server.MapPath ("aaaaaaa.jpg"), FileMode.Create))
{
byte [] b = new byte [1024];
int read = 0;
while ((read = s.Read (b, 0, b.Length))> 0)
{
fs.Write (b, 0, read);
}
}
The file can be generated, but the size is 0 K, there is no image, what's going on?
With bitmap.Save (Response.OutputStream, ImageFormat.Jpeg); you can see the picture. |
|