asp.net获取屏幕截图、活动窗口截图

时间:2014-07-22 23:14:34   收藏:0   阅读:367
  1. Rectangle R = System.Windows.Forms.Screen.PrimaryScreen.Bounds;//获取活动窗口截图
  2. //Rectangle R = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;//获取整个屏幕截图
  3. System.Drawing.Image img = new Bitmap(R.Width, R.Height);
  4. Graphics G = Graphics.FromImage(img);
  5. G.CopyFromScreen(new Point(0, 0), new Point(0, 0), new Size(R.Width, R.Height));
  6. IntPtr dc = G.GetHdc();
  7. G.ReleaseHdc(dc);
  8. G.Dispose();
  9. img .Save("c:\\a.jpg");

asp.net获取屏幕截图、活动窗口截图,码迷,mamicode.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!