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();

浙公网安备 33010602011771号