I want to get a screenshot of MainForm of Application. For this, I use the following code.
Bitmap bitmap = new Bitmap(MainForm.Width, MainForm.Height);
DrawToBitmap(bitmap, new Rectangle(0, 0, bitmap.Width, bitmap.Height));
pictureBox1.Image = bitmap;
I have some user controls in MainForm. I can only get a screenshot of MainForm using the code above. I can not get a screenshot of User Controls.
Can anyone suggest me how to get a screenshot of a windows form using form user controls?
source
share