title: Sizing and working with ICO files in WPF/C#
body: <p>In an application I'm working on there are Images (part of <code>System.Windows.Media.Imaging</code>) being created dynamically in the code-behind of a XAML page and getting added to the window. I'm using ICO files, which contain various sizes and bit depths. The size I want is 96x96 @ 32 bit. The code automatically selects the largest size (256x256 @ 32 bit).</p>
  
  <p>I'm setting the <code>Image.Source</code> property as follows:</p>
  
  <pre><code>image.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/Images/Application.ico"));
  </code></pre>
  
  <p>Now, by searching around I've found the Icon (part of <code>System.Drawing</code>) which will allow me to set a string path and size, but this is a part of an entirely different library.</p>
  
  <pre><code>new Icon("pack://application:,,,/Resources/Images/Inquiry.ico",96,96);
  </code></pre>
  
  <p>Any idea how I can make my Image's size property a bit more manageable? Thank you!</p>
  
  <p>EDIT:
  <a href="https://stackoverflow.com/questions/1127647/convert-system-drawing-icon-to-system-media-imagesource/1127795#1127795">Convert System.Drawing.Icon to System.Media.ImageSource</a> <br>
  This post gets the image to appear smaller, however, it doesn't matter if I set the Icon to 96x96 or 128x128, it doesn't actually change the displayed image's size. I'm assuming it's going to some default value that is different that the <code>System.Windows.Media.Imaging</code> default.</p>
  
  <p>EDIT to the EDIT: Weird keeps getting weirder. When I display through the original method, it's definitely displaying the image as 256x256. However, when I use the conversion method described in the link, while the sizes change, they are <i>significantly scaled down</i> (i.e. 256x256 looks closer to 48x48).</p>