Saturday, May 30, 2009

Save content of any control or form to a image

// Save content of any control or form to a image

Bitmap bitmap = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bitmap, new System.Drawing.Rectangle(new Point(0, 0), this.Size));
bitmap.Save("c:\\t.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

No comments:

Post a Comment