title: WPF Add a png image from resources with C# at runtime
body: <p>I'm trying to add an image in a stack panel at runtime. My image is in the resources of the application. Here's the code that I have for the moment:</p>
  
  <pre><code>Image image = new Image();
  ImageSourceConverter isc = new ImageSourceConverter();
  image.Source = isc.ConvertFrom(Properties.Resources.entity16_10) as ImageSource;
  image.Height = 16;
  image.Width = 16;
  panel.Children.Add(image);
  </code></pre>
  
  <p>I've got a null pointer on the line where I'm trying to use the converter, I don't know if it's the good way of doing this.</p>