Notifications
Clear all

[Closed] Assign created bitmap to button as icon

Hello,
I create a bitmap image using maxscript and after want to use it as icon for button in rollout.
Code logic look good and simple for me, but I cant figure out why it doesn’t work.

bitmapForIcon = bitmap 24 24 color:red filename:"RedIcon"
rollout rl_Test "Test" width:130 height:30
(
    button bt_myButton width:24 height:24 images:#(bitmapForIcon, undefined, 1, 1, 1, 1, 1)
)

createDialog rl_Test

I’ll appreciate any help or advice.
Thank you

1 Reply

I get it to work
Lesson from this is one ALWAYS ALWAYS define your alpha NEVER leave it undfined

bitmapForIcon = bitmap 24 24 color:red filename:"RedIcon"
bitmapAlphaIcon = bitmap 24 24 color:black
rollout rl_Test "Test" width:130 height:30

(

    button bt_myButton width:24 height:24 images:#(bitmapForIcon, bitmapAlphaIcon, 1, 1, 1, 1, 1)

)

createDialog rl_Test