Main window transparency, to be or not to be


#1

My application (on Win32) had a CPU hogging problem that went away when I set the main window to opaque. I needed it transparent to be able to draw nice rounded corners, but because of that, about 50% of CPU was used up in its paint routine. I have a lot of GUI updates in subcomponents, at least 10 times/sec, and I fear that this is why the main window keeps repainting. But by setting main window to opaque, CPU went down to below 5%.

Any ideas on how to minimize repaints, and still be able to draw nice round corners??

TIA
/R


#2

Yes, transparency in windows is massively inefficient. Not my fault though, it’s Microsoft’s!

The only thing you can really do is like I did with the drop-shadow, where you have a bunch of small transparent windows that float around the main opaque one. Trouble is, it’s not always possible to keep them together, and they might drift apart or get out-of-step.


#3

Ah, figured as much :frowning: You say windows, does that mean it is not a problem on Mac & Linux?

Thanks Jules, I’ll check the drop shadow approach.


#4