Can't set transpparent control as doublce buffer (Again)

°

°Ë´óɽÈË

Hi,
Thank you for your response. I really have some big problems in Transparent
control.
Can you help me?

1. Can you give me some detail information about double buffer transparent
control? I found that In .net FrameWork, SelectionUIService is implemented
by a double buffer transparent control, It can work.

2. I must set the parent control as ~WS_CLIPCHILDREN, the transparent
control can work. Because If I don't do it, Parent control will not repaint
the area occurred by transparent. The back ground of transparent Control
will not correct. But I don't think it is a good ideal.

3. What's different between SupportTranparentBackColor and Opaque. If I set
control as SupportTranparentBackColor And set the BackColor, It's
transparent also. I know control will not paint back ground if I set it as
Opaque. They can implement Transparent control all. But I don't know who is
the really transparent control and what the different between them.


Can you give me any information about them? Thank you very much.

Jerry


Stoitcho Goutsev (100) said:
I think you have asked this before. You cannot use build-in double buffering
with transparent controls. You need to maintain you own bitmap and blend it
with the background. If you need really simple transparency (e.g
rounded-corner buttons) take a look at control's Region property

--
HTH
Stoitcho Goutsev (100) [C# MVP]


°Ë´óɽÈË said:
HI,

I create a custom transparent control, set the style is
ControlStyles.DoubleBuffer, It display black background. How
to create a double buffer transparent control?

The ralative code is:
// in constructor
base.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.StandardClick
|
ControlStyles.Opaque, true);
 
B

Bob Powell [MVP]

It's not possible to double-buffer transparent controls. The painting of the
control depends upon getting everything behind it to paint first. The
objects behind paint onto their own DC's, not the one designated for the
double-buffer bitmap and so that bitmap never contains the underlying bits.


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

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

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

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml






°Ë´óɽÈË said:
Hi,
Thank you for your response. I really have some big problems in Transparent
control.
Can you help me?

1. Can you give me some detail information about double buffer transparent
control? I found that In .net FrameWork, SelectionUIService is implemented
by a double buffer transparent control, It can work.

2. I must set the parent control as ~WS_CLIPCHILDREN, the transparent
control can work. Because If I don't do it, Parent control will not repaint
the area occurred by transparent. The back ground of transparent Control
will not correct. But I don't think it is a good ideal.

3. What's different between SupportTranparentBackColor and Opaque. If I set
control as SupportTranparentBackColor And set the BackColor, It's
transparent also. I know control will not paint back ground if I set it as
Opaque. They can implement Transparent control all. But I don't know who is
the really transparent control and what the different between them.


Can you give me any information about them? Thank you very much.

Jerry


Stoitcho Goutsev (100) said:
I think you have asked this before. You cannot use build-in double buffering
with transparent controls. You need to maintain you own bitmap and blend it
with the background. If you need really simple transparency (e.g
rounded-corner buttons) take a look at control's Region property

--
HTH
Stoitcho Goutsev (100) [C# MVP]


°Ë´óɽÈË said:
HI,

I create a custom transparent control, set the style is
ControlStyles.DoubleBuffer, It display black background. How
to create a double buffer transparent control?

The ralative code is:
// in constructor
base.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.StandardClick
|
ControlStyles.Opaque, true);
 

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