Reputation: 1923
I programming for Windows Phone 8.1. I use this way to create image and set source of image:
Dim AgreeBitmapImage As BitmapImage = New BitmapImage()
AgreeBitmapImage.setsource(New Uri("Assets/Image/Agree.png", UriKind.Relative))
//Above line gives an error
imgAccept = New Image
imgAccept.Height = 40
imgAccept.Width = 40
imgAccept.Source = AgreeBitmapImage
When I start the emulator, it doesn't work. Why? (Say error)
Upvotes: 1
Views: 950
Reputation: 8231
In Windows Phone 8.1, the resources like png should be get using ms-appx
:
AgreeBitmapImage.UriSource =
New Uri("ms-appx:///Assets/Image/Agree.png", UriKind.Absolute)
Upvotes: 2