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

J

Jim H

I have an application that uses transparency. My video settings are
1600x1200 and 32 bit color. I can make the main dialog transparent but
other controls and child windows are not transparent, I see the colored box
around my control. If I switch my color depth to 16 bit everything is fine.
Why does it work on some forms but not others.

I can even make my main form transparent and drop a custom control that has
transparency set. The main form goes transparent but the custom control has
a blue (my transparent color) box around it. Again if I switch color depth
it works fine.

I heard that somewhere in the .NET documentation it says transparency is not
supported under 32 bit color. I have a hard time believing this. Are there
any computers that don't come in 32 bit color mode anymore?

Jim
 
J

Jeffrey Tan[MSFT]

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.
 
J

Jim H

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]" said:
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.
 
S

Stoitcho Goutsev \(100\) [C# MVP]

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 said:
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]" said:
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.
 
J

Jim H

Thanks for the reply. Transparency works on my system just not in this
case. I tested it on 4 other systems and they have the same problem in 32
bit mode. The gauge control is a square region. That's the background you
see, not the user control or the form.

I'm starting to think it's something to do with the gauge control. It turns
out even just dropping the gauge on the form shows the same problem, while
other controls it works fine.

jim

Stoitcho Goutsev (100) said:
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 said:
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]" said:
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.
 
J

Jim H

I'm starting to think it's something to do with the gauge control. It turns
out even just dropping the gauge on the form shows the same problem, while
other controls it works fine.

Jim
 
S

Stoitcho Goutsev \(100\) [C# MVP]

I tired the same gauge control and it works with me on 32 bpp. Thus I still
think that the problem is actually with the video adapter and/or drivers

--

Stoitcho Goutsev (100) [C# MVP]


Jim H said:
Thanks for the reply. Transparency works on my system just not in this
case. I tested it on 4 other systems and they have the same problem in 32
bit mode. The gauge control is a square region. That's the background
you see, not the user control or the form.

I'm starting to think it's something to do with the gauge control. It
turns out even just dropping the gauge on the form shows the same problem,
while other controls it works fine.

jim

Stoitcho Goutsev (100) said:
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 said:
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

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.
 
J

Jim H

It was a problem with the gauge control. The manufacturer confirmed it and
sent me a fix. It works fine now.

Jim

Stoitcho Goutsev (100) said:
I tired the same gauge control and it works with me on 32 bpp. Thus I still
think that the problem is actually with the video adapter and/or drivers

--

Stoitcho Goutsev (100) [C# MVP]


Jim H said:
Thanks for the reply. Transparency works on my system just not in this
case. I tested it on 4 other systems and they have the same problem in
32 bit mode. The gauge control is a square region. That's the
background you see, not the user control or the form.

I'm starting to think it's something to do with the gauge control. It
turns out even just dropping the gauge on the form shows the same
problem, while other controls it works fine.

jim

Stoitcho Goutsev (100) said:
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]


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

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.
 
J

Jeffrey Tan[MSFT]

Hi Jim,

I am glad your problem resolved. If you need further help, please feel free
to post, we will help you. Thanks

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.
 
G

Guest

Hi Jeffrey,

After reading so many messages in this post i thought may be i can address
my problem though it is slight different. I want to make the form transparent
and it is working. But i when i click on the client region of the form the
events are going to hte underlying application windows which i dont want.
Basically i am doing this because i am using the Microsoft.Ink api to draw on
the form.

I tried to use backcolor of the form to Color.Transparent but it gives
runtime error saying that "You cannot set the back color to tranparent"..

Is there any way to accomplish this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top