How to add an Image Source as a Resource in WPF

Add the image to your project and set it as a Resource in the Build Action on the Properties window

fig1.PNG


Set the Source property of the image in your XAML as follows (completely unintuitive but it works)


<
Image Source="pack://application:,,,/MyAssemblyName;component/resources/images/lightbulbssmall.png"
Ebook Download
View all
Learn
View all