Wednesday, November 19, 2014

I was asked recently how to embed and retrieve bmp file into your dll file. I’d like to take credit for figuring it out but I’m sure I originally saw it on Jeremy’s site somewhere.  Here is how I do it:


Add the image as a resource to the project
From the project menu select properties


On the resource tab select add resource


 Browse and find the image.

Once selected it should be listed in the solution explorer under the resources folder



Set the image property to embed
In the solution explorer find the image and right click and go to properties


 Set the build action to embed



Add a reference to  PresentationCore.dll




Once this is done you can use this code to retrieve the image.