title: Bitmap differences between Windows versions
body: <p>As part of some automated testing, I'm using <code>UITestControl.CaptureImage()</code> to take screenshots of UI elements and compare them against expected results.  This worked fine and dandy in my Windows 7 environment but when I started running the tests on a Windows XP machine it would produce images that are somehow slightly different from Win7 images.  That is, they are pixel-for-pixel identical, but display other differences:</p>
  
  <ul>
  <li>Using a pixel-comparison tool verifies they are identical from a visual standpoint.</li>
  <li>The bitmap on XP is about twice as large as the Windows 7 bitmap.</li>
  <li>When compared in WinMerge there are obvious differences.</li>
  </ul>
  
  <p>The code is quite simple:</p>
  
  <pre><code>public Image TakeWindowScreenshot()
  {
      Image screenshot = null;
      screenshot = uiMapAds.TestApplication.UIItemWindow.UIItemImage.CaptureImage();
      return screenshot;
  }
  
  string pathToNewScreenshot = "C:\foo.bmp";
  Image screenshot = TakeWindowScreenShot();
  Bitmap screenshotBitmap = new Bitmap(screenshot);
  screenshotBitmap.Save(pathToNewScreenshot);
  </code></pre>
  
  <p>Does anyone have any idea what is going on here?  It also works fine in Windows 8, so XP is the outlier.  Another thing that might matter is that the Windows XP machine/OS is 32-bit while the others are 64, although all bitmaps are 32 BPP.</p>