OK, I figured it out. Here's what I did:
- set
Build Action
of each image asEmbedded Resource
- replace my
MapPath
with the following piece of code:
var resourcePath = "My.Namespace." + iconPath; //iconPath = subfolder.subfolder.file.ext
using (Stream imageStream = Assembly.GetExecutingAssembly()
.GetManifestResourceStream(resourcePath))
{
...