گرفتن و تسخیر کردن (Capture) تصویر صفحه نمایش
کد:
private void button1_Click(object sender, EventArgs e)
{
this.BackgroundImage= CaptureScreen();
}
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;
}