How to read an image from resource file

  • Thread starter Thread starter DBC User
  • Start date Start date
D

DBC User

Hi,
I have bunch of image files I want to add it to the resource file at
the design time and I would like to read them from the resource file.
Could soneone point me to a link or give me some advice on how to do
this? All the search I found is to add them through programs but I
would like to do it at design time.

I did create a folder in the solution and put the files in the folder
and in the program I used BitMap.FromFile("../../Resources/image.ico")
and it worked. But I do not want to hard code the logic and all I want
to hard code is the name of the image not the location.

Any help?

Thanks.
 
Hi,

Not too sure this the right way to use it but i always have this in my code
when refering images from resource

syntax:
global::<projectname>.Properties.Resources.<resourcename>;

e.g.
global::WindowsApplication2.Properties.Resources.help;


If you have anything better please share i love to find out the proper way
too.
 
Thi,

Do you have a sample code on how to get it?

On my intellisense I can go only upto

global::<projectname>.Properties.Resources

If you could drop me sample that would be great.
Thanks.
 

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

Back
Top