Transparency in button ?

Just starting out? Need help? Post your questions and find answers here.
DominiqueB
Enthusiast
Enthusiast
Posts: 103
Joined: Fri Apr 25, 2003 4:00 pm
Location: France

Transparency in button ?

Post 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]
Dominique

Windows 10 64bits. Pure basic 32bits
Franky
Enthusiast
Enthusiast
Posts: 213
Joined: Sat Apr 26, 2003 2:58 pm

Post 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
Give Up everything but trying!
DominiqueB
Enthusiast
Enthusiast
Posts: 103
Joined: Fri Apr 25, 2003 4:00 pm
Location: France

Thnak's a lot !

Post 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.
Dominique

Windows 10 64bits. Pure basic 32bits
User avatar
blueb
Addict
Addict
Posts: 1118
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Post by blueb »

:D

Thanks Dominique!

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

--blueb
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Besides, I don't have an icon editor.
http://users.pandora.be/liontech/IconShop.zip

:D
--Kale

Image
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Thanks Kale, I'll check it out. :)
Post Reply