It's easy!
1. Create a Bitmap object of the size of your control.
Bitmap picture = new Bitmap (800, 600);
2. Create a Graphics object from the Bitmap Object.
Graphics graphx = Graphics.FromImage(picture);
3. Draw your user control to the Graphics object.
CreateControl(graphx);
4. Save your picture to a file.
picture.Save(@"C:\ControlImage.bmp");
It's that simple!
No comments:
Post a Comment