I fail to access Resource image file from code in WPF using pack Uri
c#, resources, wpf
Solution
In the end with all types of ways to approach this resource, my problem was i forgot 1 folder in the sub folders.
This code eventually worked :
new BitmapImage(new Uri("pack://application:,,,/Resources/Images/Output/"
+ i.ToString() + ".jpg", UriKind.Absolute)));
Problem
I have some image resources in my app i want to access programaticly. Now i'm based on some source code so i need to acess via Uri so my code is : ``` new BitmapImage(new Uri("pack://application:,,,/YearBook;component/Resources/Output/" + i.ToString() + ".jpg", UriKind.RelativeOrAbsolute)); ``` though when i try to access it i get error that resources not found ( and the name is right) Anyone knows why? EDIT: Might be i needed to add some assembly in the assembly file?