现在的位置: 首页 > 综合 > 正文

用C#实现全屏幕抓图

2013年05月26日 ⁄ 综合 ⁄ 共 391字 ⁄ 字号 评论关闭

int width = Screen.PrimaryScreen.Bounds.Width;

            int height = Screen.PrimaryScreen.Bounds.Height;

            Bitmap bmp = new Bitmap(width, height);

            using (Graphics g = Graphics.FromImage(bmp))
            {

                g.CopyFromScreen(0, 0, 0, 0, new Size(width, height));

            }
            bmp.Save(@"c:\1.jpg");
            bmp.Dispose();

 

参考:http://dotnet.chinaitlab.com/CSharp/794536.html

抱歉!评论已关闭.