I am having a hard time changing my image. I am pretty sure it has something to do with image.source
i can get my img to show the .source but i dont know how to put in the value for the new picture..
Any idea?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bechir BejaouiPosted Sep 6, 2008, 5:42 AM
but in wpf context this is the appropriate code:
Image myImage3 = new Image();
BitmapImage bi3 = new BitmapImage();
bi3.BeginInit();
bi3.UriSource = new Uri("smiley_stackpanel.PNG", UriKind.Relative);
bi3.EndInit();
myImage3.Stretch = Stretch.Fill;
myImage3.Source = bi3;
this example is found in MSDN
Bechir BejaouiPosted Sep 6, 2008, 5:42 AM
but in wpf context this is the appropriate code:
Image myImage3 = new Image();
BitmapImage bi3 = new BitmapImage();
bi3.BeginInit();
bi3.UriSource = new Uri("smiley_stackpanel.PNG", UriKind.Relative);
bi3.EndInit();
myImage3.Stretch = Stretch.Fill;
myImage3.Source = bi3;
this example is found in MSDN