Home

Bug when dumping a solid colored bitmap of Color.FromArgb(35, 35, 35)

The following C# code dumps an image to the results window which is completely transparent. If I have a window behind the LINQPad window, I will see the other window, otherwise I will see my desktop wallpaper. This should display a large nearly black square.

using (var lBitmap = new System.Drawing.Bitmap(1024, 1024)) using (var lGraphics = System.Drawing.Graphics.FromImage(lBitmap)) { lGraphics.Clear(System.Drawing.Color.FromArgb(35, 35, 35)); lBitmap.Dump(); }

Comments

  • I ran some more tests with this. It seems to work correctly on Windows 7, though it exhibits the transparent behavior on Windows Vista.
  • I ran some more tests with this. It seems to work correctly on Windows 7, though it exhibits the transparent behavior on Windows Vista.
    ...and on Windows 8
  • This occurs because LINQPad sometimes uses this color as a transparency key. This is to allow rich-client objects to be hosted in separate application domains on their own message loops, while maintaining the illusion of being parented to the host application, without any flicker.
Sign In or Register to comment.