取得当前屏幕的图像

来源:互联网 发布:交通仿真软件市场分析 编辑:程序博客网 时间:2024/05/21 22:36

           Bitmap img = new Bitmap(Screen.PrimaryScreen.Bounds.Width,Screen.PrimaryScreen.Bounds.Height);
            Graphics g = Graphics.FromImage(img);
            g.CopyFromScreen(new Point(0, 0), new Point(0, 0), Screen.PrimaryScreen.Bounds.Size);