Typed this straight in so apologies in advance for syntax errors.
Make sure you've imported System.Windows.Resources and System.Windows.Media.Imaging
If TheImage.png is located in Images folder and build action is set to Resource:
Code:
Dim sri As StreamResourceInfo = Application.GetResourceStream(New Uri("SilverlightApplication1;component/Images/TheImage.png", UriKind.Relative))
Dim bmp As New BitmapImage
bmp.SetSource(sri.Stream)
image1.Source = bmp
If TheImage.png is located in Images folder and build action is set to Content:
Code:
Dim sri As StreamResourceInfo = Application.GetResourceStream(New Uri("Images/TheImage.png", UriKind.Relative))
Dim bmp As New BitmapImage
bmp.SetSource(sri.Stream)
image1.Source = bmp
If TheImage.png is somewhere out on the web:
Code:
image1.Source = New BitmapImage(New Uri("http://domain.com/TheImage.png", UriKind.Absolute))