private void button2_Click(object sender, EventArgs e) { using (var bmp = new Bitmap(MyPanel.Width, MyPanel.Height)) { MyPanel.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height)); bmp.Save(@"images/" + txtImage.Text + ".bmp"); } }
private void button2_Click(object sender, EventArgs e) { using (var bmp = new Bitmap(MyPanel.Width, MyPanel.Height)) { MyPanel.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height)); bmp.Save(@"images/" + txtImage.Text + ".bmp"); } }