c# 8条语句实现屏幕抓图
1Image myImage = new Bitmap(300, 200);
2Graphics g = Graphics.FromImage(myImage);
3g.CopyFromScreen(new Point(Cursor.Position.X - 150, Cursor.Position.Y - 25), new Point(0, 0), new Size(300, 200));
4IntPtr dc1 = g.GetHdc();
5g.ReleaseHdc(dc1);
6this.pictureBox1.Image = myImage;
7myImage.Save("c:\\1.jpeg");
8
2Graphics g = Graphics.FromImage(myImage);
3g.CopyFromScreen(new Point(Cursor.Position.X - 150, Cursor.Position.Y - 25), new Point(0, 0), new Size(300, 200));
4IntPtr dc1 = g.GetHdc();
5g.ReleaseHdc(dc1);
6this.pictureBox1.Image = myImage;
7myImage.Save("c:\\1.jpeg");
8