comicalvery
comicalvery

Reputation: 91

A generic error occurred in GDI+. How to fix?

I have seen this error pop up everywhere, but most of the answers don't seem to work for me. I am trying to save a PictureBox image to a directory. The code I havePictureBox1.Image.Save("C:\Users\khale\OneDrive\Pictures\Screenshots"). It is very simple and I thought it would work because there were no errors or warnings. I press run and run the function that calls the code, and bam, error pops up. Thanks for reading, bye.

Upvotes: 1

Views: 95

Answers (1)

jmcilhinney
jmcilhinney

Reputation: 54417

It looks like you have provided a folder path rather than a file path. There can be other reasons for that exception but that would be one reason.

Upvotes: 2

Related Questions