title: Determine whether an image is PNG despite .BMP extension
body: <p>I want to check if images in a directory are of type png but with extension <code>.bmp</code>. The following determines whether it is a <code>.bmp</code> extension</p>
  
  <pre><code> string x = Path.GetExtension(file);
  </code></pre>
  
  <p>From this we establish that its extension is <code>.bmp</code>. Now the problem comes in checking if it is in a png format. I am stuck on this part. </p>
  
  <p>The reason why I am doing this is because I want to have my images transparent and .bmp images don't work so well with that.
  Thank you!</p>