在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
using System.Drawing;
//打开该页面
System.Threading.Thread.Sleep(3000); //截屏 //创建并设置画布大小 System.Drawing.Image templateImage = new System.Drawing.Bitmap(1040, 700);
System.Drawing.Graphics templateG = System.Drawing.Graphics.FromImage(templateImage); //new Point(200, 100)位于源(屏幕)左上角的x,y坐标 //new Point(0, 0)图片位于画布左上角的x,y坐标 //new Size(1440, 900)所截屏幕的大小 templateG.CopyFromScreen( new Point(200, 100), new Point(0, 0), new Size(1000, 900), CopyPixelOperation.MergeCopy);
//关闭ie System.Diagnostics.Process[] pro = System.Diagnostics.Process.GetProcessesByName( "IEXPLORE" );
foreach (System.Diagnostics.Process ps in pro)
{ ps.Kill();
} //保存 templateImage.Save( @"E:\TEST\" + imgname + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
|
请发表评论