title: Clipboard shows it has "Dib" format but it cannot fetch it?
body: <p>I am trying to get a <code>bool</code> value if an image/picture copied to the clipboard contains any transparency and for that I am using <a href="https://github.com/skoshy/CopyTransparentImages/blob/304e383b8f3239496999087421545a9b4dc765e5/ConsoleApp2/Program.cs#L79" rel="nofollow noreferrer">this answer</a>, which I found on GitHub. It will get the picture in the clipboard in the <code>DataFormats.Dib</code> format and then iterate over that in a <code>byte[]</code> array to check for transparency.</p>
  <p>My problem is that for certain images, then the clipboard data return <code>null</code> though the clipboard states it does contain the format!? I cannot figure out what is wrong and why it behaves like this on some images. I have the below example code:</p>
  <pre><code>// This will return &quot;true&quot; on my problematic image
  bool hasDibFormat = Clipboard.GetDataObject().GetDataPresent(DataFormats.Dib);
  
  if (hasDibFormat)
  {
      // This will return &quot;null&quot; on my problematic image
      var dib = Clipboard.GetData(DataFormats.Dib);
  }
  </code></pre>
  <p>In the real code then this line is the problem for me:</p>
  <pre><code>// Line &quot;84&quot; in the attached code
  dib = ((System.IO.MemoryStream)Clipboard.GetData(DataFormats.Dib)).ToArray();
  </code></pre>
  <p>... and I get this error when copying an image from <em>Outlook</em> - but only for some pictures:</p>
  <blockquote>
  <p>System.NullReferenceException: 'Object reference not set to an instance of an object.'</p>
  </blockquote>
  <p>The image where I have a problem has these formats:</p>
  <p><a href="https://i.stack.imgur.com/6xAaA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6xAaA.jpg" alt="Picture formats" /></a></p>
  <p>Any insights would be appreciated :-)</p>