myImage.Source = new BitmapImage(new Uri("/folder/imagename.png", UriKind.Relative));
This used to work in WPF applications for Windows 7, but there, in Windows 8, I got an error
Thanks in advance.
home / developersection / forums / how to change image dynamically in wpf?
myImage.Source = new BitmapImage(new Uri("/folder/imagename.png", UriKind.Relative));
This used to work in WPF applications for Windows 7, but there, in Windows 8, I got an error
Thanks in advance.
Sumit Kesarwani
03-Sep-2013The Image.Source property is of type ImageSource. Therefore, try the following example:
myImage.Source = "/YourApplicationName;component/folder/imagename.png";