Hi,
I am screen capturing as follows:
Bitmap b = new Bitmap(ScreenWidth, ScreenHeight); g = Graphics.FromImage(b); g.CopyFromScreen(Point.Empty, Point.Empty, Screen.PrimaryScreen.Bounds.Size); b.Save(@"S:\\shot" + i.ToString() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); i = i + 1;
The problem is when I lock the computer, it gives
The handle is invalid exception for the line below:
g.CopyFromScreen(Point.Empty, Point.Empty, Screen.PrimaryScreen.Bounds.Size);
How can I fix this?
Best Regards.