开发者

Can I make use of the printscreen button in C# to store an image for later use

开发者 https://www.devze.com 2023-02-17 15:09 出处:网络
I want to take a screenshot of the form and then use it later to make it the background of the form. this would requi开发者_StackOverflow社区re the use of PrintScreen button I think. Is there any way

I want to take a screenshot of the form and then use it later to make it the background of the form. this would requi开发者_StackOverflow社区re the use of PrintScreen button I think. Is there any way to do this?


Rectangle area = Screen.GetWorkingArea(this);
Bitmap bmp = new Bitmap(area.Width, area.Height);
using(Graphics g = Graphics.FromImage(bmp))
    g.CopyFromScreen(area.Left, area.Height, 0, 0, new Size(area.Width, area.Height));
this.BackgroundImage = bmp;
0

精彩评论

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

关注公众号