- Rectangle R =
System.Windows.Forms.Screen.PrimaryScreen.Bounds;//获取活动窗口截图 - //Rectangle R =
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;//获取整个屏幕截图 - System.Drawing.Image img = new Bitmap(R.Width, R.Height);
- Graphics G = Graphics.FromImage(img);
- G.CopyFromScreen(new Point(0, 0), new Point(0, 0), new Size(R.Width,
R.Height)); - IntPtr dc = G.GetHdc();
- G.ReleaseHdc(dc);
- G.Dispose();
- img .Save("c:\\a.jpg");
asp.net获取屏幕截图、活动窗口截图,码迷,mamicode.com
时间: 2024-10-05 12:31:35