Add a Button and change its name to GetCapture and write this below code on Button’s Click event handler.
private void GetCapture_Click(object sender, EventArgs e)
{
this.BackgroundImage= CaptureScreen();
}
{
this.BackgroundImage= CaptureScreen();
}
Write this below code on class Form
private Image CaptureScreen()
{
Bitmap screen = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height);
using (Graphics g = Graphics.FromImage(screen))
{
g.CopyFromScreen(0, 0, 0, 0, screen.Size);
}
return screen;
}
{
Bitmap screen = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height);
using (Graphics g = Graphics.FromImage(screen))
{
g.CopyFromScreen(0, 0, 0, 0, screen.Size);
}
return screen;
}