Semi Transparent Panel Background

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
roweiss
Member
Posts: 12
Joined: Thu Mar 10, 2005 12:34 am

Semi Transparent Panel Background

Post by roweiss »

I'm trying to use a PNG image with semi-transparent sections as the background for a popup panel in the software remote. It does not appear to work. It automatically places a black background behind the image.



Alternatively, I tried using a BMP file with regional transparency, ALL transparent. Then I placed my PNG image (with semi-transparency) on top as an image control. In this case, the software remote will not display the panel at all.



If I change the BMP background so that it does not have regional transparency, then the panel shows up, and my PNG semi-transparency shows through, however it's to the solid background on the panel. What I really want is to show through to the underlying panel.



Am I doing something incorrectly, or is this just not supported?
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

For Panels, you can only use the background transparency masks (defining a single color to use as the transparent color) to create non-rectangular or cut-out windows. Semi-transparencies won't work. I suppose you could create a pixel grid using a transparent color that would give a pseudo-transparent effect.


Alternatively, I tried using a BMP file with regional transparency, ALL transparent. Then I placed my PNG image (with semi-transparency) on top as an image control. In this case, the software remote will not display the panel at all.
The regional transparencies actually define where the window/Panel will be and where it will be open below. You are effectively carving out the window. So if you try and put a control on an area that was carved out, the control will not show.
Scott
roweiss
Member
Posts: 12
Joined: Thu Mar 10, 2005 12:34 am

Post by roweiss »

Scott,



Thanks for your response.



I guess I was hoping that there would be a way for the implementation to use the PNG image and only carve out portions of the window where the PNG is 100% transparent. Then for the areas where it's semi-transparent, it could show through the contents of the underlying window. It's been a while since I coded in this space, however, I'm presuming this is a limitation/restriction of the Windows GDI implementation that requires any window background to be fully opaque?



In any case, thanks.



Rick
roweiss
Member
Posts: 12
Joined: Thu Mar 10, 2005 12:34 am

Post by roweiss »

I was just looking at the CreateWindowEx Function and noticed that there's a dwExStyle called WS_EX_TRANSPARENT, which it appears would allow you to in essence create a transparent window. Given this, what I suggested in the previous post with respect to how to handle a PNG file as the background of a panel might be possible.



What do you think?
Post Reply