I put a PANEL on WINFORM, and then loaded a lot of controls drawn by GDI on PANEL. How can I print out the contents of this PANEL, that is, these controls drawn by GDI?
bmp = new Bitmap (width, height);
g = Graphics.FromImage (bmp);
g.FillRectangle (Brushes.White, 0, 0, rect.Width, rect.Height);
// The drawing method is executed once for g here
//then
bmp.Save (ms, ImageFormat.Jpeg);
Thank you for giving me an idea upstairs, but the control of the GDI painting I loaded is a one-by-one report. If you ensure that the printed content and other formats are correct,