毎秒、次のコードで画面をキャプチャします。最初の 40/50 回は機能し、その後、InvalidArgumentException
コードの 1 行目と 3 行目に が表示されます。
Bitmap bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics g = Graphics.FromImage(bmpScreenshot);
g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);
bmpScreen = bmpScreenshot;