How to use from the code the image that I import to visual studio?

0

I'm making an application in WPF (C# y XAML) .

I used these instructions to import an image to Visual Studio : which I then want to show in a part of the application. link

Now, what I want to achieve is to manipulate this image from the code, instead of referencing it from the pure%% co, as it appears in this image:

How do I do it?

Maybe my question is very obvious or simple, but I do not find anywhere to do this.

Thank you very much!

    
asked by JGuerra 05.04.2018 в 18:50
source

1 answer

0

After importing the images: link

        digital_watch = new Image();
        digital_watch_image = new BitmapImage(new Uri(@"images\digital_watch.png", UriKind.RelativeOrAbsolute));
        digital_watch.Source = digital_watch_image;
        Grid.Children.Add(digital_watch);

That's how you manipulate the image.

    
answered by 05.04.2018 в 20:53