I am creating a pretty standard business application in WPF. I need to use icons for the toolbars and menu items, and in a few other places. I'd like to know the answers to three (likely interrelated) things:
- What format should I use for the images? ICO? PNG? JPG? GIF?
- How do I store the images in my VS2008 project? As files on disk? In a RESX file? In a resource dictionary? (If in a resource dictionary, do they then also have to be on disk before the dictionary is "compiled"?)
- Once the files are stored appropriately in my project, how best to reference them?
Thanks!
Update:
I accepted Chris Nicol's answer, but I want to clarify what I did for the record.
- I created a folder in my project called Images.
- I put my images into this folder, and made sure that their build action was "Resource".
- I created a ResourceDictionary XAML file called Images.xaml. Inside of this, I created an entry for each file, in the following format:
BitmapImage x:Key="FooIcon" Source="Images\foo.png"
. - I then referenced this ResourceDictionary in the usual way as needed.
My primary concern was that the resulting images be added to the DLL as resources and that they be accessible through WPF's Resource system.