Custom form transparency problem

Hi,

I tried to use the method mentioned here but I experienced the following:

I have a background bmp file and it has rounded edges with different colors at the edges of the image (the edges are red). I set the TransparencyKey to red but they were still visible. Then I found two articles.
The first claims that when one uses screen color depth higher than 16-bit, the transparencykey property stops to work. (The article is dated about 2002 and uses .Net FW 1.1). I found another on here (watch the last image inscription).
The second one is a bug: when the DoubleBuffer property set to true, the transparencykey won't work, either. Here is this article.
My application uses DoubleBuffer so I set the labels to System FlatStyle but no result (with disabled DoubleBuffer, no result). Any suggestion



Answer this question

Custom form transparency problem

  • soulmate75

    Hi,

    I found the reason of my program's failure in visualization.
    Here is the article of the bug. It says: "Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article." It is dated to December 11, 2006, so it's a fresh review.
    I tried the workaround but with the image I was unable to make it transparent, so I implemented a checkbox to enable or disable the background image.
    I hope MS will fix it soon. (It would be appreciated)
    I found a solution of GDI region modifier/cutter , it is quite easy to use, but has limitations of parameterizing.
    I consider my question as unsolvable so it can be sunk.


  • tala

    Hi,

    No solution yet, but I searched for confirmation of my previous statement, and found the article, which says: "Note Monitors set to a color depth of greater than 24-bit can display problems with certain parts of the form not being transparent, despite setting of the TransparencyKey property. To avoid this problem, ensure that the monitor's color depth is set to less than 24-bit in the Display control panel. When developing applications that feature this transparency, keep in mind that you will have to make your users aware of this issue." -- I don't like that word there: despite - the form should obey its creators "commands" :).
    As it is an MSDN article, I guess, it is not wrong, so it seems necessary to set the color depth to 16-bit that is a little bit..how to say...non-21st century solution. :)
    If anyone has suggestion, write it.

    Edit: I made some progression: I removed the bmp file and set the form's background color to red, then transparency key to red, so my form is invisible. It seems the cause of the problem is the image. It is a 24-bit BMP file, containing red edges. Should I use another file format


  • Custom form transparency problem