Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Drawing / May 2008

Tip: Looking for answers? Try searching our database.

OptimizedDoubleBuffer and Layered Window!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Özden Irmak - 07 May 2008 12:53 GMT
Hello There,

I've a layered window where I put a control in it to show as a popup. I'm
providing rounded borders as well.

I'm using Vista as My test environment and today noticed a strange thing.
When Glass is enabled, there is no problem but when it's disabled (Vista
Basic), the parts of the popup which should be transparent was visible.
After some tests, I could correct this by turning the OptimizedDoubleBuffer
to false in my control. I also saw this behavior in some XP boxes as well.

My question is that, what is OptimizedDoubleBuffer doing differently in
those 2 situations which makes the Layered Window to behave not correctly
(My suspicious is that the created Graphics object does not hold a 32bit
buffer in Vista Basic state) ? Is there any possibility to correct this as I
don't want to sacrifice from double buffering?

Thanks in advance...

Regards,

Özden
Bob Powell [MVP] - 09 May 2008 07:53 GMT
using double buffering on a layered window is  waste of time. Layered window
provides a graphics device that is already attached to an in-memory bitmap
which, depending on the LayeredWindow API used, is composited to the screen
using either a global transparency or a per-pixel alpha value.

The only thing you're doing when you double buffer a layered window is to
decrease the graphics bandwidth.

Signature

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

Ramuseco Limited .NET consulting
http://www.ramuseco.com

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.

> Hello There,
>
[quoted text clipped - 19 lines]
>
> Özden
Özden Irmak - 09 May 2008 14:40 GMT
Hello Bob,

Actually I've noticed that layered windows are drawn different than regular
windows before. It's good to hear that LayeredWindow does already provide
something like a double buffer within it. In that case, all I've to do is
switch off double buffering of a control whenever I need to show it in a
popup.

Thank you very much...

Regards,

Özden Irmak

> using double buffering on a layered window is  waste of time. Layered
> window provides a graphics device that is already attached to an in-memory
[quoted text clipped - 27 lines]
>>
>> Özden

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.