I want to add an image from my Resources to an Image on the press of a Button.
Using Image1.Source = Properties.Resources.MyImage Does not work because the Image1 is of type ImageSource and the Left side is of type Drawing. How can I fix this code to display the image in my resource to the Image on button press?
Pravesh Singh
23-Sep-2013This seems to work:
In app.xaml:
in MainWindow.xaml:
in button click event:
So in your code you need to do :
Image myImage = Properties.Resources.MyImage as Image;
Image1.Source = myImage.Source;