所以我有这个表单,如果用户按下一个按钮,这个方法就会被执行:
//Takes a screenshot of the screen to send it with the email
private void screenshot()
{
Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics graphics = Graphics.FromImage(printscreen as Image);
graphics.CopyFromScreen(0,0,0,0, printscreen.Size);
printscreen.Save(@"C:\Users\*******\Desktop", ImageFormat.Jpeg);
}
但是当我按下按钮时,我收到以下错误: GDI+ 中发生一般错误。
有任何想法吗?
提前致谢。