Click to See Complete Forum and Search --> : Control transparency


Shambler
May 31st, 2006, 05:51 AM
I have an image (with an alpha channel) being drawn onto a button through the OnPaint event and I want the transparent parts of that image to make that area of the entire form see-through (in some cases 100% see-through, depending on the alpha value obviously).

The problem is, I can't seem to get that working...I've tried clearing the graphics buffer with Color::Transparent, not clearing it at all, using ControlStyle::Opaque, ControlStyle::SupportsTransparentBackColor but no luck sofar.
Does anyone have a soloution for this? (apart from drawing the buttons from within the form itself)

Thanks.

Lee Cheon-Sin
June 1st, 2006, 05:56 AM
Windows does not support such transparency. Either the entire window is transparent to a certain level. invisible, or opaque. You cannot make certain parts of the window less or more transparent than another, except for invisible or opaque (which can be mixed). You'll have to draw those parts of the form yourself. Just remember to get the area behind the form.