Re: Why does transparency only work sometimes with 32 bit color depth?

From: Stoitcho Goutsev \(100\) [C# MVP] (100_at_100.com)
Date: 10/20/04


Date: Wed, 20 Oct 2004 12:30:10 -0400

Hi Jim H

I tested the transparency key with 32bit colors and they works fine for me.
Frankly, I haven't heard that .NET doesn't support transsparency in 32 bit
mode and it doesn't make sense to me.

I believe the problem is rather with your video adapter. There are question
like yours asked before. The answer of the first that I found in google
(posted by Justin Rogers) is

"Some graphics cards, eg Vipers, don't properly support transparency at
32-bit color."

Anyways you can work around your problem. The circular shape of the gauge
conrol is done by setting the control's region property. What you can do is
to get that region Control.Region property and set it to the form that
caries the gauge. This what you are going for, I believe

-- 
HTH
Stoitcho Goutsev (100) [C# MVP]
"Jim H" <nospam@jimsaccount.com> wrote in message 
news:OnlQDVntEHA.3972@TK2MSFTNGP15.phx.gbl...
> My friend has a single monitor system.  I just tested it on a Windows 2003 
> Server single monitor with an Intel motherboard and onboard video chipset. 
> In 32 bit mode transparency does not work.  3 different machines 3 
> different video cards, so I'd say hardware is out.
>
> I tried just using a simple test project with a button on a user control 
> and a plain form, but that works fine.  Unfortunately a button on a user 
> control does not help me with my project.  The simple scenarios usually 
> work unless some tester really messed up.
>
> The control I'm using is a Dundas .NET gauge control.  You can download it 
> from:
> http://www.dundas.com/products/gauge/index.aspx?Section=Gauge
> Evaluation is free and full featured.  They just put a water mark on the 
> gauge face in the eval version.
>
> If I drop a gauge on the form the background will be transparent just like 
> it should.  If I drop the gauge on a user control and drop that control on 
> a form the background is not transparent in 32 bit mode, but the gauge 
> right next to it that was a control dropped directly on the form has a 
> transparent background.  No hand written code at all.
>
> I guess it could be the gauge control but it's purely .NET.  I'll contact 
> them as well.  From what I've been reading trying to figure this out, I'm 
> not the only person having this 32 bit problem.  I don't know what 
> everyone else having this problem is doing to trigger it though. (They 
> have nothing to do with the Dundas stuff).
>
> Let me know if you are able to try it.
> Thanks again,
> jim
>
> ""Jeffrey Tan[MSFT]"" <v-jetan@online.microsoft.com> wrote in message 
> news:dFJX$nltEHA.3312@cpmsftngxa10.phx.gbl...
>> Hi Jim,
>>
>> Thanks very much for your feedback and detailed explaining!
>>
>> Yes, I think I understand your problem. But on my side with one monitor 
>> and
>> 32 bit color depth, if I set the a form's TransparencyKey to
>> SystemColors.Control(which is the backcolor of form). The form will go
>> transparent.
>>
>> For your issue, I think we should first isolate several possible factors
>> such as software code or hardware.
>> 1. I think you first not use the third party gauge control, but just 
>> place
>> some normal winform control on the form, then change the control's
>> backcolor not to be SystemColors.Control, and set the the form's
>> TransparencyKey to SystemColors.Control. Does this goes transparent in 
>> your
>> 2 monitor machine?
>>
>> 2. Does your friend's machine with normal one monitor or just 2 monitors
>> like your machine? I think you may test your problem application in some
>> one monitor machine. If this problem does not arise, it should be 
>> hardware
>> issue.
>>
>> 3. If you still can not figure out this issue, I think you may just send 
>> a
>> sample project to me to help reproduce out in my side. Then we will help
>> you better.
>>
>> Thank you for your patience and cooperation. If you have any questions or
>> concerns, please feel free to post it in the group. I am standing by to 
>> be
>> of assistance.
>>
>> Best regards,
>> Jeffrey Tan
>> Microsoft Online Partner Support
>> Get Secure! - www.microsoft.com/security
>> This posting is provided "as is" with no warranties and confers no 
>> rights.
>>
>
>