Notifications
Clear all

[Closed] Full Transparent Button In Maxscript Rollout

Hello
As a new maxscript user I’m writing a script in RolloutFloater mode and I’m struggling to have a button (like Max’s Ribbon) with full transparency in the RolloutFloater window. I tried very much to do that with imgTag or Image Buttons and seems Impossible I rather if it is possible NOT to use .NET programming. Any way, with or without .NET I’ll appreciate your help. Thanks a lot.
The script so far:

(		
local Windowrollout
theFloater = newRolloutFloater "Test" 210 200 
	rollout Windowrollout "Window" width:180 height:149
(
	button closebt "Close" pos:[67,101] width:45 height:32	
	on closebt pressed do
(
	if theFloater.dialogBar then (cui.unRegisterDialogBar theFloater ) 
	closeRolloutFloater theFloater
	)
	)
addRollout Windowrollout theFloater rolledUp: false 
cui.RegisterDialogBar theFloater
	)

Please Help

9 Replies
local   ExpBtnImages = #("qExport_16i.bmp", "qExport_16a.bmp", 2, 1, 1, 1, 1, true);
  
  button do_the_export_btn  offset:[14,-3] images:ExpBtnImages border:false;

where qExport_16i.bmp is a 32bit bitmap image strip of 16×16 images and theres no qExport_16a.bmp max will look for the alpha in qExport_16i.bmp, the image should be saved in the folder

getdir #userIcons

or else specify the full path.
See Image Buttons in mxs help for the other settings meaning in the ExpBtnImages array… though <colortheme_boolean> is not used

Happy New Year to you and Thank you for the quick reply very much.
I just did what you said. there is a ugly white edge around the image which is a 32 bit BMP with alpha image in it.

what if you try…

Images = #("AtmosApp_16i.bmp", "AtmosApp_16a.bmp", 3, 1, 1, 1, 1, true);

Still seeing a hard edge around circle-like form images like an apple. Transparency is kind of working on rectangular images. When a PNG file format with alpha mask inside is used the result is a little bit better. But there is sunken edge again. Icons in Max’s Riboon are very smooth. I’ve even tried using “ImgTag UI Control” but the same result. why should an image button with normal transparency be so hard in MAX 2014 and Windows7? Thank you Klunk for your help any other Idea?

AFAIK, you can’t have a real alpha with buttons created with Maxscript.
You can have a 1-bit transparency only.
With PNG, it will consider the average grey (128,128,128) as the threshold for transparent and non-transparent pixels.

I know it is not what you want to hear but it is true, I think. We all lost mental sanity trying to achieve smooth button transparency…

Hard to hear. Thank you feranti

I hope someone will rise in some reply to show us how to do it, but this never happened int others topics dedicated to this subject

Exactly. Or maybe in next versions of Max developers consider to make this easily possible.

I was looking for an answer to something else when I saw this but just wanted to chime in.
I’m using some denisT code to ‘gray out’ button icons in a script I’m writing. I had some arrows that were black and weren’t being affected by the graying code so I decided to lower the alpha mask values. Max is definitely dropping the opacity of the icons based directly on the alpha channel of the bitmap and it actually looks pretty nice.

btn.images = #(“btnIcons.bmp”,undefined,26,1,1,1+13,1+13,false,true)

I’m pretty sure it’s because the useWindowsColorTheme boolean is set to true (the last array element). This also automatically adapts your icons to the different Max UI color themes. If it’s set to false I notice my icons seem to revert back to a strictly on/off masking deal again. I’m using Max 2011. Hopefully I didn’t misunderstand the problem and make an idiot out of myself :\