Nargzul
asked on
Load external ressources in c#
For a program I need to load and assign dynamically an image.
I've something like this:
FileStream file;
file = File.Open(@"./Ressources/l ed_on.png" , FileMode.Open);
ledON = Image.FromStream(file);
But it's search in the bin/Debug repository. Is it possible to search the ressource folder in the source folder?(or have an automatic copy?)
I've something like this:
FileStream file;
file = File.Open(@"./Ressources/l
ledON = Image.FromStream(file);
But it's search in the bin/Debug repository. Is it possible to search the ressource folder in the source folder?(or have an automatic copy?)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
?
Sorry, I don't know what you mean. But what I mean is:
1. go to the Solution Explorer
2. Select the Resources/myfile.png file
3. Select the Properties window (right-click > Properties)
4. Change the "Copy to Output Directory" setting
that's all there is to it ;-)
Sorry, I don't know what you mean. But what I mean is:
1. go to the Solution Explorer
2. Select the Resources/myfile.png file
3. Select the Properties window (right-click > Properties)
4. Change the "Copy to Output Directory" setting
that's all there is to it ;-)
ASKER
Is it a way to include files corresponding to a pattern?
Like ressources/*.(png|jpg|gif)