Click here to Skip to main content
15,889,863 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i Never had this type of conversion.

iam a beginer.
please help me improve my skill.
Posted
Comments
johannesnestler 9-Jul-15 8:07am    
convert the GUI to an image? Do you mean to take a "screenshot"? of your GUI?
Sergey Alexandrovich Kryukov 9-Jul-15 11:16am    
What kind of GUI? The answer depends on the UI library/framework you are using.
—SA

1 solution

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");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900