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;
精彩评论