我正在尝试使用屏幕形式截取屏幕截图,但我不希望我的表单包含在屏幕截图中。这是我当前获取屏幕截图的代码。
Bitmap bt;
Graphics screenshot;
private void button1_Click_1(object sender, EventArgs e)
{
this.Opacity = 0;
bt = new Bitmap(Screen.FromControl(this).Bounds.Width, Screen.FromControl(this).Bounds.Height, PixelFormat.Format32bppArgb);
screenshot = Graphics.FromImage(bt);
screenshot.CopyFromScreen(Screen.FromControl(this).Bounds.X, Screen.FromControl(this).Bounds.Y, 0, 0, Screen.FromControl(this).Bounds.Size, CopyPixelOperation.SourceCopy);
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBox1.Image = bt;
this.Opacity = 1;
}
这在一定程度上有效,但问题是当我这样做时,它会导致屏幕每次闪烁。有没有办法让它不包括我的表格,但仍然把一切都放在后面?