Question: 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:

```none
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.

Answer: 
```
picBox.Image = Image.FromFile("image.png");

```

you may want to create a new URI which points to the actual image
Check this [link](http://msdn.microsoft.com/en-us/library/system.windows.controls.image.source%28v=vs.95%29.aspx) out.

In C# it would be:

```
Image myImage = new Image();
myImage.Source = new BitmapImage(new Uri("myPicture.jpg", UriKind.RelativeOrAbsolute));

```