Transparency issue

Having problems? Maybe others have had the same problem too. Post HouseBot technical issues here.
Post Reply
jasonb1
Member
Posts: 34
Joined: Tue Nov 11, 2003 12:50 am

Transparency issue

Post by jasonb1 »

If you have a mixture of transparent labels and transparent buttons near each other, they don't mix well if the label rectangle intersects the button rectangle.



I'm pretty sure that this is because the theme stuff uses child hwnds (verified using Spy++) and that Windows hwnds don't have a transparency model that supports n levels of layering in a supported way. Before deciding to use HouseBot, I was looking at writing a WinForms app and during that resarch, I came across this transparency problem with hwnds that didn't have any real good non-hacky solutions.



So, I don't actually expect this to get fixed any time soon... :D
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Jason,



In previous versions (prior to 1.60), all transparency was to the panel background. I like using "Image" controls as groupings for other controls, which always created the problem that the transparency for the controls in the group was showing the Panel background instead of the Image control that they were sitting on. In rewriting a lot of the Theme image processing, I fixed it so all Image controls would combine their images with the Panel background (and other overlapping image controls) and this combined image would then be the background for all other controls. However, I didn't go to the next step to combine ALL controls into the layered background because:
  • Speed - Even combining the image controls is a performance hit. Since generally there are few Image controls and many more 'other' controls, it was an acceptable trade-off. I wasn't sure if combining all controls would be worth it (granted, I could be a bit more intelligent when combining and only look for overlapping controls).
  • Difficulty - Controls that use images are easy to combine into a composite background image. Other controls that are built by the OS (like the edit control or the directory and list controls), or any control whos image changes (a large number of these), make it difficult to synthesize a composite background without the use of true transparent windows. It can be done, but it's a few more hoops to jump through.
  • Reality - I couldn't think of a practical application where you would want controls to overlap (other than image controls). I think your scenario of overlapping edges is valid in tight Themes.
These are the reasons that I didn't go the extra mile and implement that level of transparency in 1.60. It may still be resolved in a future build, but don't wait for it :wink:



Scott
Post Reply