Page 1 of 1

Transparency in button ?

Posted: Sat Sep 06, 2003 2:36 pm
by DominiqueB
Help.

I need to add a button with image to a toolbar.
The image is a bmp, how can i make its bacgroung colour to be transparent on the toolbart button ?

Thank's

Dominique[/img]

Posted: Sat Sep 06, 2003 2:49 pm
by Franky
You could change the backgroundcolor of your image into the color of a toolbarbutton

Look here (by Danilo; German Forum)
http://www.robsite.de/php/pureboard/viewtopic.php?t=718

Thnak's a lot !

Posted: Sat Sep 06, 2003 3:23 pm
by DominiqueB
It work's great!
A litle tip:

by adding this:
Result = SaveImage(1, "test2.bmp")

just after the line:
ImageGadget(0,0,0,ImageWidth(),ImageHeight(),image1)

you save the result and then can use it in your app.

Thank's.

Dominique.

Posted: Sat Sep 06, 2003 3:42 pm
by blueb
:D

Thanks Dominique!

That's going to save a lot of time (and code)!

--blueb

Posted: Sat Sep 06, 2003 5:07 pm
by GPI
Note, that it is very easy to change the background-color of a window of all windows.

So it would be a better idea to use .ico instead of .bmp. Because Icons saves a transperancy.

Posted: Sun Sep 07, 2003 4:23 am
by PB
> it would be a better idea to use .ico instead of .bmp. Because Icons
> saves a transperancy.

Bitmaps can have transparency too, and are not restricted to 32x32 pixels
like an icon. See here: viewtopic.php?t=7230

Posted: Sun Sep 07, 2003 9:38 am
by GPI
>Bitmaps can have transparency too, and are not restricted to 32x32 pixels
>ike an icon.

Icons are definitly not restricted to 32x32. I created much bigger one. (The logo in japbe is a icon, also the PB-Logo in jaPBe.) And at the moment icons are the only format that PB support with direct transparancys.

>See here: viewtopic.php?t=7230

That are not realy transparencys. This function only change one color to a other.

Posted: Sun Sep 07, 2003 12:11 pm
by PB
> Icons are definitly not restricted to 32x32. I created much bigger one.
> (The logo in japbe is a icon, also the PB-Logo in jaPBe.)

Okay, I was not aware of that. Thanks for the clarification.

> See here: viewtopic.php?t=7230
> That are not realy transparencys. This function only change one color
> to a other.

Fair enough, but the tip there gives the effect of transparency with bitmaps,
which is all that matters in the end. :wink: Besides, I don't have an icon editor.

Posted: Sun Sep 07, 2003 12:49 pm
by Kale
Besides, I don't have an icon editor.
http://users.pandora.be/liontech/IconShop.zip

:D

Posted: Sun Sep 07, 2003 4:34 pm
by PB
Thanks Kale, I'll check it out. :)