I’m trying to create a screenshot of the entire screen, not just the window that Unity is running in, but currently the image file that is saved is just black.
Relevant code at the moment:
Bitmap screenGrab = new Bitmap(screenWidth, screenHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb); System.Drawing.Graphics sG = System.Drawing.Graphics.FromImage(screenGrab); sG.CopyFromScreen(screenWidth, screenHeight,0,0, screenGrab.Size, CopyPixelOperation.SourceCopy); screenGrab.Save("TestScreen.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
It saves an image of the correct resolution, screenWidth and screenHeight are the correct size of my monitor, I’ve tried Save() with different filetypes, but I still just get a 100% black image. If it helps at all, I mainly followed this tutorial to create the script.