Sign in to follow this  
Followers 0
sdak

Howto display a bitmap in a button with a transparent color

7 posts in this topic

Firstly thanks for AutoIt !

My question is :

Howto display a bitmap in a button with a "transparent color" or

make a button with both, graphic and text ?

sdak

Develop'it

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Easiest way is to make a BMP with the same background color as your GUI. But, you can use a transparent region instead of a button. Search for transparent region in v3 Scripts and Scraps.

Edited by peter1234

Share this post


Link to post
Share on other sites

Add $WS_LAYERED to your GUI properties. The color of the top-left pixel of the GUI will be made transparent throughout the GUI, including buttons, text, etc.

I recommend making if FF00FF, or pure red or something like that.


Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

Share this post


Link to post
Share on other sites

Add $WS_LAYERED to your GUI properties. The color of the top-left pixel of the GUI will be made transparent throughout the GUI, including buttons, text, etc.

I recommend making if FF00FF, or pure red or something like that.

Thanks for the answer (also peter1234) !

Please, can you give us a example, because I can't find propertie $WS_LAYERED, I use $WS_EX_LAYERED

but the window refuse to open when I use it.

Sebastien

Develop'it

Share this post


Link to post
Share on other sites

Yes, that's one example. Another is here:

$gamegui = GUICreate("QBC", 1280, 1024, -1, -1, $WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX, $WS_EX_LAYERED)

A good tip to all: "$WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX" will remove a windows title and sidebars.


Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

Share this post


Link to post
Share on other sites

Should use the BitOr() rather than the '+'

$gamegui = GUICreate("QBC", 1280, 1024, -1, -1, BitOR($WS_POPUP, $WS_SYSMENU, $WS_MINIMIZEBOX), $WS_EX_LAYERED)
I know the Help file had/has an example using the '+'


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0