title: Pixel-perfect 'nearest neighbor' scaling
body: <p>I have an <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.image.aspx" rel="nofollow">Image</a> as shown below. When zooming in (enlarging the image), I want to <strong>preserve the pixels as much as possible</strong>. Hence, interpolation should be avoided. E.g. Zooming 1700% implies a solid 17x17 pixel area for each and every pixel. (I understand this becomes problematic for values like 1730%.)</p>
  
  <pre><code>&lt;Image Stretch="Uniform" Source="C:\test.png"
         &lt;!-- 4 important values --&gt;
         SnapsToDevicePixels="True"
         UseLayoutRounding="True"
         RenderOptions.EdgeMode="Aliased"
         RenderOptions.BitmapScalingMode="NearestNeighbor"/&gt;
  </code></pre>
  
  <p><strong>Q:</strong> What combination of these four settings is the best in this case?</p>