Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
where does the image save? I don't understand what "frame.Bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);" means ? save image or not it is just something like a buffer?

What I have tried:

pictureBox1.Image = frame.ToBitmap();
     MemoryStream ms = new MemoryStream();
     frame.Bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
     bytes = ms.ToArray();
     acc.Send(bytes, 0, bytes.Length, 0);
Posted
Updated 20-Mar-19 3:22am

The Save(stream, format) method saves the image to the stream that is passed into it in the format that is specified.
Image.Save Method (System.Drawing) | Microsoft Docs[^]
 
Share this answer
 
It saves to MemoryStream. You can save the result (ms.ToArray()) using File.WriteAllBytes(String, Byte[]). However, this has nothing to do with sending the image to the client. You need to save image on the server, with the path accessible from the website and provide (to client) relative path to the image.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900