I’m trying to import an image into an “Image” box in c#.
I have found when doing it in XAML it’s just
source = "file location"
but when I try the following code in C#
myimage.source = "image.png"
my image being the name of the “Image” box it just returns this error:
Error: Cannot implicitly convert type 'string' to 'System.Windows.Media.ImageSource'
when looking online everyone seems to just quote using picture box but I don’t have access to picture boxes, and if I didn’t and point in the program “myimage” is displaying a live video stream. So, an image box is required I think.
Check this link out.
In C# it would be: