The following example source code shows how to capture the form and save it to a bitmap. Hope you find it useful.
Point point = new Point();
Rectangle rectangle = new Rectangle(point, this.Size);
Bitmap bitmap =
new Bitmap(rectangle.Width, rectangle.Height, PixelFormat.Format32bppRgb);
// render the form to the bitmap
this.DrawToBitmap(bitmap, rectangle);
bitmap.Save(@"d:\MyForm.bmp");
No comments:
Post a Comment