Please never post about an error without telling us the error message.
Image.FromFile loads a file from a file name so my guess is that you perhaps
thought you used image file resources (?) when your resources are actually
just the file names.
It worked as long as the exe file and the image files were in the same
directory but stopped working then...
You could :
- either keep this and specify the directory from which image files should
be loaded
- truly add images as resources in which case you'll have just to do
PictureBox1.Image=My.Resources.ResourceFile.MyImag e...
--
Patrice
<kr*******@yahoo.co.uka écrit dans le message de groupe de discussion :
e5**********************************...oglegroups.com...
I have an image which I need to load
PictureBox1.Image = Image.FromFile(My.Resources.myimage)
and this worked fine when the image (myimage.jpg) was in the debug Bin
directory. I now am moving them all to
a folder called Resources and specify the files as above. Doesn't work
though and the file is definitely there and VB.Net recognizes it when
I type in the expression. What's wrong? it's looking for a string.
Thanks
K.