Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / BlueGUI transparency question

Author
Message
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 16th Jan 2008 15:15
Is it possible to create images for tool bar buttons and panels with transparency, how?

[center]
CREATE games with ease! NO programming required!
WIP
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 16th Jan 2008 22:09
Yes for the image,
addToolbarButton [handle gadget, int index, bool isToggleButton] | [handle gadget, str fileName, bool isToggleButton], [str tooltip]

I don't think you can set the alpha or panels though. I only got it to work with windows, and the panels took the alpha over from their parent window.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 17th Jan 2008 11:19
First off with transparency I mean that some pixels are transparent while others are not, like with a GIF. Not to alter the alpha of the entire gadget.

Anyways, the toolbar only seem to accept BMP images and I can't seem to get any transparency. When a button is turned off and becomes gray all white pixels become transparent but they are solid white when enabled. The default buttons work nicely but not my own. I use 24 bit BMPs.

[center]
CREATE games with ease! NO programming required!
WIP
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 17th Jan 2008 17:50
You use the command 'setGadgetShape' Look at the help file for it, it will tell you how to use it

cjb2006
17
Years of Service
User Offline
Joined: 20th May 2006
Location:
Posted: 17th Jan 2008 20:14 Edited at: 17th Jan 2008 22:26
I've been watching this thread hoping RobK would respond - but since he hasn't, and I need this also, I spent some time and figured it out. You need to make a single bitmap "strip" 16 pixels high and the number of buttons times 16 pixels wide. For the transparent color use rgb(255,0,255) on the bitmap. Then, when you addToolbarButton, just use same bitmap name over and over and it will apply them in the order they appear on the bitmap strip you made.

EDIT - this is for toolbar buttons. I've uploaded a sample strip that works (used a resource hacker to get it) but I can't make one of my own. This must be a special bitmap format.

EDIT 2: The format is 256 color. I use Paint.net as my image editor and it doesn't seem to have support for saving these bitmaps. I haven't checked to see if they have a plugin but MS Paint will write a 256 color bitmap that works.

Attachments

Login to view attachments
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 18th Jan 2008 14:39
Thanks for the replies, I'll see what I can come up with

[center]
CREATE games with ease! NO programming required!
WIP
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 18th Jan 2008 15:18
Diggsey:
setGadgetShape doesn't seem to have any effect on panels, at least not those with an image on. The help file mentions windows in particular.


cjb2006:
I did a quick test with my tool bar images and the result is that any color can be used as transparency as long as the image is in 8 bit (compressed or not). Whatever color you have in the bottom left corner will be considered as transparent.

[center]
CREATE games with ease! NO programming required!
WIP
cjb2006
17
Years of Service
User Offline
Joined: 20th May 2006
Location:
Posted: 18th Jan 2008 15:38
Good to know, thanks.

Login to post a reply

Server time is: 2024-05-04 05:47:35
Your offset time is: 2024-05-04 05:47:35