title: WPF: "Value of type 'String' cannot be converted to 'System.Windows.Media.ImageSource'."
body: <p>I'm trying to set a WPF Image's source.</p>
  
  <p><strong>XAML</strong> works:</p>
  
  <pre><code>&lt;Image Name="ImageThing"
         Source="images/Thing.png"/&gt;
  </code></pre>
  
  <p><strong>Visual Basic</strong> fails:</p>
  
  <pre><code>ImageThing.Source = "images/Thing.png"
  </code></pre>
  
  <p>&hellip;with this <strong>exception</strong>:</p>
  
  <blockquote>
    <p>Value of type 'String' cannot be
    converted to
    'System.Windows.Media.ImageSource'.</p>
  </blockquote>
  
  <p>How do I create the System.Windows.Media.ImageSource that I need?</p>
  
  <hr>
  
  <h2>Update</h2>
  
  <p>This code adapted from an <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.image.aspx" rel="noreferrer">MSDN example</a> works:</p>
  
  <pre><code>Dim bmp As New BitmapImage()
  bmp.BeginInit()
  bmp.UriSource = New Uri("images/Thing.png", UriKind.Relative)
  bmp.EndInit()
  ImageThing.Source = bmp
  </code></pre>