asp.net获取屏幕截图、活动窗口截图
时间:2014-07-22 23:14:34
收藏:0
阅读:367
- 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");
评论(0)