I know this question has been answered before. But none of the answers are correct. How can I capture the image of a windows form and save it. I use this:
Bitmap bmp = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bmp, new Rectangle(Point.Empty, bmp.Size));
bmp.Save(@"C://Desktop//sample.png",ImageFormat.Png);
but get the error:
A generic error occurred in GDI+
I have also read about this error but none of the suggestions work for me! Please help