Olukayode Oluwole
asked on
How can i point to a default image in my C# application
I have a default image i want to use in C# application
I stored the default image in c:\crystal\images\defaulti mage.png
I am trying to point to it in my application as my default image but
somehow pointing to the file with pbxPhoto.Image = ("C:\Crystal\Images\defaul timage.png ");
gives a syntax error (see attached)
Please note that i am getting the error in the code even before running
How can i resolve this error
ImagePath230319.PNG
I stored the default image in c:\crystal\images\defaulti
I am trying to point to it in my application as my default image but
somehow pointing to the file with pbxPhoto.Image = ("C:\Crystal\Images\defaul
gives a syntax error (see attached)
Please note that i am getting the error in the code even before running
How can i resolve this error
ImagePath230319.PNG
what error you are getting ?
ASKER
If you look at the attached file you will see the slash character between the folders
being flagged.
This is more like a syntax error and of course i cant run with the error
Regards
Olukay
being flagged.
This is more like a syntax error and of course i cant run with the error
Regards
Olukay
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
either use your appsettings or copy the image to your source directory and then use a relative path from there
https://www.youtube.com/watch?v=fzfztjaqR18
https://www.youtube.com/watch?v=fzfztjaqR18
ASKER
I have tried both options with the 2 statements
pbxPhoto.Image = Image.FromFile("C:\\Crysta l\\Images\ \defaultim age.png");
pbxPhoto.Image = Image.FromFile(@"C:\Crysta l\Images\d efaultimag e.png");
I got the same error File not Found (see attached)
Even though the file exists.
What could I be doing wrong
Olukay
pbxPhoto.Image = Image.FromFile("C:\\Crysta
pbxPhoto.Image = Image.FromFile(@"C:\Crysta
I got the same error File not Found (see attached)
Even though the file exists.
What could I be doing wrong
Olukay
ASKER
Thanks for the effort.
I would have loved to listen to the UTube video but there is no voice
Regards
I would have loved to listen to the UTube video but there is no voice
Regards