开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜