c# 8条语句实现屏幕抓图
Image myImage = new Bitmap(300, 200);Graphics g = Graphics.FromImage(myImage);g.CopyFromScreen(new Point(Cursor.Position.X - 150,Cursor.Position.Y - 25), new Point(0, 0), new Size(300, 200));IntPtr dc
·
Image myImage = new Bitmap(300, 200);
Graphics g = Graphics.FromImage(myImage);
g.CopyFromScreen(new Point(Cursor.Position.X - 150,Cursor.Position.Y - 25), new Point(0, 0), new Size(300, 200));
IntPtr dc1 = g.GetHdc();
g.ReleaseHdc(dc1);
this.pictureBox1.Image = myImage;
myImage.Save("c://1.jpeg");
Graphics g = Graphics.FromImage(myImage);
g.CopyFromScreen(new Point(Cursor.Position.X - 150,Cursor.Position.Y - 25), new Point(0, 0), new Size(300, 200));
IntPtr dc1 = g.GetHdc();
g.ReleaseHdc(dc1);
this.pictureBox1.Image = myImage;
myImage.Save("c://1.jpeg");
更多推荐



所有评论(0)