OuterPages outer=new OuterPages(); Controls.Add(outer.TestPage); SaveBitmap(); //OuterPage is a class that contaings the panel TesPage and many controls in it //including RichTextBox. public void DrawControl(Control control, Bitmap bitmap) { control.DrawToBitmap(bitmap, control.Bounds); foreach (Control childControl in control.Controls) { DrawControl(childControl, bitmap); } } public void SaveBitmap() { Rectangle rc = new Rectangle(0, 0, outer.TestPage.Width, outer.TestPage.Height); Bitmap bmp = new Bitmap(outer.TestPage.Width, outer.TestPage.Height); outer.TestPage.DrawToBitmap(bmp, rc); foreach (Control control in outer.TestPage.Controls) { DrawControl(control, bmp); } // outer.TitleRichTextBox.DrawToBitmap(bmp, rc); This is not working. bmp.Save("C:\\Users\\Missak\\Desktop\\panel.jpg"); }
System.Windows.Forms
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)