View Full Version : SECBitmapButton Tooooooooo Sloooooooow

07-17-2008, 08:19 AM
Ok, the title is too bad? :p
I'm working to recomplie our software from Stingray 2006v2 to Stingray Studio 10.
But one problem was blocking to release the new programs:
Working with themes, the button's refresh was slow, 20 buttons refresh time is near 1 second, and was human visible.
I debugged the code, and found that the problem is the method used for the painting of bitmap in RWUxTheme library.
I've modified the code of RWDrawDCImage and RWDrawDCFullImageShadow, and the refresh time is very improved!
The bottle neck is the double for cicle calling the SetPixelV for each pixel...

There is possible to improve this code?

For the RWDrawDCImage i use the RWTransparentBlt if there is no hiContrast, else the normal function, but for RWDrawDCFullImageShadow I make a simplier grayed button using masks...

Mike Weiss
09-24-2008, 06:13 AM
I had the same problem if upgrading TO 2006 last year! (I guess I should come to these forumns more often). I had issues with toolbar drawing.

I've made tons of changes to the RWUXTheme dll.

- I changed RWTransparentBlt to just call the GDI's TransparentBlt
- I added a new method similar to RWDrawDCFullImageShadow that draws the disabled image with TransparentBlt after adjusting the contrast. I replaced calls to drop shadow with this new call. (I could do this since I override all drawing anyway.
- I changed RWPaintGradientRect to draw less gradiant levels, have it cache the brushes it creates, and some simple 8-bit color support.