开发者

How can i save the screen as an image from a .NET forms application in C#

开发者 https://www.devze.com 2022-12-14 08:27 出处:网络
I have a .NET 3.5 Windows forms application. When the user keys in data and clicks \'Save\', i 开发者_如何学Cwant to save the entire form as an image file.

I have a .NET 3.5 Windows forms application. When the user keys in data and clicks 'Save', i 开发者_如何学Cwant to save the entire form as an image file.

How can i do this ?

Thanks, Chak.


Have a look at my answer on this question. It shows how to take a screenshot of the whole screen.


You can create a bitmap in size of your screen (System.Windows.Forms.Screen class), create a System.Drawing.Graphics object for it (Graphics.FromImage) and then use Graphics.CopyFromScreen.

You may ve also able to use Form.DrawToBitmap.

0

精彩评论

暂无评论...
验证码 换一张
取 消