65.9K
CodeProject is changing. Read more.
Home

Load external images in WPF via XAML ?

starIconstarIconstarIconstarIconstarIcon

5.00/5 (2 votes)

Apr 18, 2010

CPOL
viewsIcon

30532

Sometimes we need to show an external image directly in WPF.Assume we have a folder that is named images beside of our main's WPF exe file. There is an image in this folder that's named sample.png.Now with the following XAML code, we can show it in WPF directly:<Image...

Sometimes we need to show an external image directly in WPF. Assume we have a folder that is named images beside of our main's WPF exe file. There is an image in this folder that's named sample.png. Now with the following XAML code, we can show it in WPF directly:
<Image Source="pack://siteoforigin:,,,/images/sample.png" />