PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Art Araya on April 30, 2005, 02:20:50 PM

Title: Toolbar - transparent image background
Post by: Art Araya on April 30, 2005, 02:20:50 PM
How do I setup the toolbar buttons so that the background color of the images becomes transparent (same color as the toolbar).  

It is not sufficient to just do this in an image editor since the toolbar color is different in different OSs(Win2000 is different color than WinXP).  

What is needed is a way to make the background of the images transparent.  A mask color is the way I am used to doing this but I don't see any way to define a mask color in the toolbar editor.

TIA
Title: Toolbar - transparent image background
Post by: TechSupport on April 30, 2005, 03:00:51 PM
Hi Art,

You're probably right. If you look at the FireFly generate source you will see that FireFly creates image lists to handle the 3 different image states (normal, disabled, hot). The image is added using the mask as follows:

ImageList_AddMasked(FF_ImageListNormal, FF_tempLong, GetSysColor(%COLOR_BTNFACE))

I think that you're right in assumming that if the background color in the bitmap is not the same as the one defined in the system as %COLOR_BTNFACE then the transparancy will not work correctly.

The most versatile solution would be to allow the mask color to be selected by the user, or use the most top left pixel in the bitmap as the transparant color.

Anyone else have any thoughts on this?
Title: Toolbar - transparent image background
Post by: Art Araya on April 30, 2005, 06:34:26 PM
<The most versatile solution would be to allow the mask color to be selected by the user>

This is the way I have seen this handled in other places.  If the toolbar editor allowed the developer to select the mask color, this would resolve the problem.  The mask color that I have seen most often used as the default is magenta.

Do you think that this is something that you can implement in the toolbar editor?

TIA
Title: Toolbar - transparent image background
Post by: Roger Garstang on April 30, 2005, 08:33:37 PM
Haven't messed with toolbars much, but can't you make the images icon/ico files that will have transparent colors that will show the background through???  The only issue I've had with image lists is the XP themes not painting through the transparent sections...it only uses the image list background.
Title: Toolbar - transparent image background
Post by: Art Araya on May 11, 2005, 01:28:20 PM
As a follow up to this post.  I converted the BMPs I was using for the toolbar into ICOs with transparent backgrounds and was able to achieve the results I wanted.  So, this is definitely acceptable as a workaround while we await the addition of user-defined mask colors for toolbar bitmap images.
Title: Toolbar - transparent image background
Post by: Roger Garstang on May 11, 2005, 02:55:49 PM
Loading a bitmap with LR_LOADTRANSPARENT and/or LR_LOADMAP3DCOLORS would be the only way to get it transparent.  ICO files are the way to go...they give you more options and are smaller than BMP.