Click here to Skip to main content
15,891,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In Design I drag a picturebox control inside Form1.
In the properties for Picturebox - Image - I select "Local resource:" - Import and Open a image. When I press [Start Debugging (F5)]Button, I get 5 errors all the same text :
Microsoft Visual Studio (name of the window error) Code generation for property 'Image' failed. Error was: 'A generic error occurred in GDI+.'

------------
I google the error and I get that is about folder security property. So I go to the folders themselves, and start erasing and adding security. But one thing go to another and they didnt let me change anything because they were depending on the root folder D:\. And i change there too. I give "full control" to everything i could.
In the root folder D:\ now I have SYSTEM;Administrators (username-PC\Administrators); Users (username-PC\Users) as my Security names.
And the original error for the c# Picturebox image didnt change after all the folder security tweeking i did.
---
I think i did it this time. I am so worried.
Thank you for any kind of help.

What I have tried:

---
I think i did it this time. I am so worried.
Thank you for any kind of help.
Posted
Comments
Richard Deeming 26-Apr-18 14:27pm    
Unfortunately, "A generic error occurred in GDI+" is a generic error that gets thrown in any number of situations - invalid or unsupported images, problems reading the file, problems with the calling code, etc.

There isn't a one-size-fits-all solution, and there's no simple way to work out what's causing the problem.

Start by trying with a different image.
_Q12_ 26-Apr-18 14:57pm    
My dear Richard Deeming, you are right! I did load that image with some other image editors and save it as diferent image extensions, and also jpg's. And I did more tests and it is as you say its the image fault !!! Very weird, since i did the original image as I usually did 10000 others too.
---
But what about the security resets I did so far? Are they a problem to fear off? I mean, i set them as intuitively i though so far(as i mention in my original post). I was thinking that the software must have some wird names for security to be in effect, with that error i got. But now i see its not coming from the MVS software, and i start to breath again. But tell me if its a big problem i did so far or not? I had to re calibrate some other 'stuck' folders too after resetting the main d:\ folder security. Including my Project folder for MVS. It probably was a big fat coincidence? Please make a solution to give you the credit and som stars.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900