Using the resource folder

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

kimiraikkonen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top