private void FullScreen_Click( )
{
//创建图象,保存将来截取的图象
//Bitmap image = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Bitmap image = new Bitmap(700, 500);
Graphics imgGraphics = Graphics.FromImage(image);
//设置截屏区域 柯乐义
imgGraphics.CopyFromScreen(new Point(200,300), new Point(0, 0), new Size(700, 500)); //第一个参数是截图开始坐标,第二个参数是要拷贝到的Bitmap的开始位置,保持不变,最后是图片大小
//保存
image.Save("a.png");
MessageBox.Show("保存成功");
}
C#截图
最新推荐文章于 2024-09-28 17:59:54 发布