winform GDI基础(四)简单截屏

            Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
            Graphics g = Graphics.FromImage(bitmap);
            g.CopyFromScreen(new Point(0, 0), new Point(0, 0), Screen.PrimaryScreen.Bounds.Size);
            bitmap.Save(Application.StartupPath + @"\截图.png");
            bitmap.Dispose();
            bitmap.Dispose();

  

posted @ 2019-03-07 15:52  翻白眼的哈士奇  阅读(338)  评论(0编辑  收藏  举报