<pre> using (Bitmap graphicSurface = new Bitmap(panel1.Width, panel1.Height)) { using (StreamWriter bitmapWriter = new StreamWriter("TEST.JPEG")) { panel1.DrawToBitmap(graphicSurface, new Rectangle(0, 0, panel1.Width, panel1.Height)); graphicSurface.Save(bitmapWriter.BaseStream, ImageFormat.Jpeg); } } }
new StreamWriter("TEST.JPEG")
new StreamWriter("[your desired path]\TEST.JPEG")
new StreamWriter("C:\\Path\\To\\Save\\The\\File\\TEST.JPEG")
new StreamWriter(@"C:\Path\To\Save\The\File\TEST.JPEG")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)