views:

1315

answers:

3

Background: I am currently using custom controls within my C# project (basic controls just drawing a custom look and feel (using gdi+?)). The majoritiy of these controls have transparent segments for irregular shapes etc.

Problem: I am looking to overlay a semi-transparent (irregularly shaped) panel over a group of controls. Currently I Clip the covering panel to the region of the controls involved. This works fine and the results look good, however the process is so slow.

Question: Is there some manner I can speed up the rendering process by mixing in a little OpenGL/DirectX and getting the video card to perform all the necessary rendering rather than relying on the rather slow CPU?

+3  A: 

AFAIK you can't really mix GDI+ and OpenGL/DX.

If you're getting slow performance and are absolutely sure that it's a bottleneck in GDI+ rather than in your code, than it could make sense to ditch GDI+ and replace it with DX/OGL. (You would have to write your own controls, though, which would be a major pain in the @$$)

Or, for a simpler approach, try WPF/Silverlight! It's customizable and skinnable by default and it's based on DX.

Loris
Unfortunatly, I don't have the time to do a fully DX system nor learn Silverlight. To that end Im not even sure if the target XP laptop *can* run silverlight!
TK
You can mix GDI+ and DirectX.
OJ
A: 

Did you try turning on DoubleBuferring on your controls to see if that gives you a performance boost?

http://www.codeproject.com/KB/graphics/DoubleBuffering.aspx

Sijin
Yes I have, although that doesn't appear to give any advantage. Although this is something that I havent really tested. The c# app is currently all double buffered.
TK
+2  A: 

Look at WPF and Silverlight. you would sleep better at night.