I am working on a silverlight applica开发者_开发问答tion and I want add Image source through Code behind so I am adding image source like this
img.Source = new BitmapImage(new Uri(@"C:\Users\Jitendra\Pictures\2006-09-11 001\Kamlesh\DSC_0261.JPG", UriKind.Absolute));
This will not work.
But look at this into the WPF it's working fine.
Your C drive isn't accessible when you run your application. Try adding the image to your project and use a relative URI.
精彩评论