Using the resource folder

  • Thread starter Thread starter kronecker
  • Start date Start date
K

kronecker

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.
 
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.

Hi,
Maybe you linked the image instead of embedding, see your
application's Properties -> Resources, then click on your image, then
check the option called "persistence", maybe you can change it
"embedded in .resx" if it was set to "linked at compile time" by
default.

And maybe that may be helpful:
http://visualbasic.about.com/od/usingvbnet/a/ResVBNET.htm

Hope this helps,

Onur Güzel
 
Back
Top