我想下面的代碼來捕捉截圖:問題,同時節省截圖
Bitmap bitmap = new Bitmap (Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);
graphics.CopyFromScreen(25, 25, 25, 25, bitmap.Size);
bitmap.Save("C:\\Users\\Mayank\\Desktop\\Screenshot\\", ImageFormat.Bmp);
最後一行導致到以下錯誤:發生在GDI 一般性錯誤+
請幫助:)
bitmap.Save應該得到一個文件不是目錄。你嘗試過嗎? –