I have panel and various controls on it. I would like to save an image of this panel into a file, how can I do this ?
Ineed to do something like screenshot, but I n
Use the Control.DrawToBitmap() method. For example:
private void button1_Click(object sender, EventArgs e) { using (var bmp = new Bitmap(panel1.Width, panel1.Height)) { panel1.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height)); bmp.Save(@"c:\temp\test.png"); } }