Uri for bitmap in subfolder (c# wpf)
- by the empirical programmer
I have a wpf app where I'm using an image. To reference the image I use:
Uri uri = new Uri("pack://application:,,,/assemblyName;Component/myIcon.png");
BitmapImage(uri)
If I add the png directly under the csproj file (with its properties BuildAction=Resource) then it works fine.
But I want to move it to a subfolder under the csproj. Another SO question asked about bitmaps\uri's (857732) and an answer linked to this msdn. So I tried :
Uri uri = new Uri("pack://application:,,,/assemblyName;Component/Icons/myIcon.png");
But that did not work.
Any ideas?