MakeTransparent vs TransparencyKey ?

  • Thread starter Thread starter Anthony Hughes
  • Start date Start date
A

Anthony Hughes

I've got a form which uses a background bitmap to create an irregular shaped
window.

According to KB822495 you need to use both MakeTransparency on your bitmap and
then set TransparencyKey on the form to get around a bug when redering on
24pdd or greater displays.

The problem I've got is that the MakeTransparent call then causes black text
on my form to become partially transparent, even though I'm using pure magenta
as my transparency colour for both the bitmap and the form.

Any ideas wht this is happening? What exactly does MakeTransparent do to the
bitmap?

Cheers
Ant
 
MakeTransparent changes the alpha settings for specific colours in the
bitmap. The effect is cumulative so if you use the commands
MakeTransparent(Color.Black) and MakeTransparent(Color.Magenta) then BOTH
the black and the magenta will become transparent.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
MakeTransparent changes the alpha settings for specific colours in the
bitmap. The effect is cumulative so if you use the commands
MakeTransparent(Color.Black) and MakeTransparent(Color.Magenta) then BOTH
the black and the magenta will become transparent.

Thanks Bob - that clarifies things.... But - if form transparency only
supports colour keying, not alpha transparency I'm not sure I understand why
this step is necessary, or why it then turns Black transparent....

Cheers
Ant
 
Back
Top