Jason_liu

导航

C#屏幕截图

int width = this.webBrowser1.Width;
    int height = this.webBrowser1.Height;
    string str = DateTime.Now.Minute.ToString() + DateTime.Now.Millisecond.ToString();
    Bitmap image = new Bitmap(width, height);
    Graphics graphics = Graphics.FromImage(image);
    graphics.CopyFromScreen(base.Location.X + 13, base.Location.Y + 100, 0, 0, Screen.AllScreens[0].Bounds.Size);
    graphics.Dispose();
    image.Save(DateTime.Now.ToString("yyyymmddhhmmssmmmm") + ".jpg");

posted on 2012-09-14 22:04  Jason_liu  阅读(197)  评论(0编辑  收藏  举报