here is a snippet of my code where it bombs out on me:
private void SaveFile()
{
// Set the bitmap object to the size of the screen
bmpPicture = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap
gfxScreenShot = Graphics.FromImage(bmpPicture);
// Take the screenshot from the upper left corner to the right bottom corner
gfxScreenShot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y + 25, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen
bmpPicture.Save(FilePath, ImageFormat.Bmp); //****THIS IS WHERE THE ERROR IS THROWN****
}


Sign In
Create Account

Back to top









