jheppinstall
jheppinstall

Reputation: 2358

Storing Images to use in application

I would like to store some images to use in my C# application. They are png files and are currently in a folder with the dlls. Ideally I would like to have them included with the dll so i dont have to include the actual images with the installation.

What is the best way to do this?

I have though about resx but i am unsure as to the best way to go about it. Should I use create the resx file using another project, and then add it to the one I want to use it with?

Thanks in advance.

Upvotes: 0

Views: 360

Answers (2)

scottm
scottm

Reputation: 28699

The easiest is to just add them to your current project and then set their Build Action property to Embedded. I believe that automatically adds them to a resource file and then you can access them using reflection.

Here's an article on retrieving them:

MSDN

Upvotes: 3

Otávio Décio
Otávio Décio

Reputation: 74290

Put them in a resource file. You can add it to the same project, no need to create another one.

Upvotes: 2

Related Questions