Use Base64 DotNet Image Encoder for buttons with alpha
Is it possible to use Base64 DotNet Image Encoder http://lonerobot.net/?p=314
in connection with http://www.scriptspot.com/3ds-max/tutorials/maxscript-image-button-bmp-l...
so that I could encode both - image and alpha and call functions for both images?
logo.images = #((StringToImage img_logo), (StringToImage img_logo_alpha), 1,1,1,1,1 )
for example inside this code (by barigazy)
rollout testRoll "LOGO" ( --if you want to convert image to string see these link: http://www.scriptspot.com/3ds-max/scripts/base64-dotnet-image-encoder local img_logo = "..."--encoded image local img_logo_alpha = "..."--encoded image alpha local ConvertClass = dotNetClass "System.Convert" local ImageClass = dotNetClass "System.Drawing.Image" fn StringToImage str = -- http://lonerobot.net/ ( byteArr = ConvertClass.FromBase64String str memstream = dotnetobject "System.IO.MemoryStream" byteArr DecodedImg = ImageClass.fromstream memstream memstream.close() ; return DecodedImg ) dotnetcontrol logo "Label" pos:[0,0] width:100 height:100 on testRoll open do (logo.image = (StringToImage img_logo)) ) createDialog testRoll 100 100 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow) )
Comments
hmmm
Thx barigazy! You really helped me a lot!
Look! I've found the solution with alpha
inside on open... I need to use
but what should I put instead of "slategray", in order to detect the color scheme?
:)
Don't tell me that you forget to add backcolor:)
If you need max default BG and FG color than you can use this
But I prefere this method for custom color
bga
Also put all your .net
Also put all your .net objects (controls) definition inside function. You can save time a lot.
Example for labeldefinition
You welcome ;)
bga
STRANGE
I get white inside image where I have transparency! I've saved it correctly in png format! I'm sure about that!
may be I need background!
Very interesting about saving to hdd! But I don't understand why, anyway, it's giving the image! Is it about speed?
Create a Bitmap containting text from a String
Code by Rafaelo Insanto Steves
bga
same author
bga
THANK YOU SO MUCH!
I will try now!!!
One more tip
Look at this Pete tool http://www.scriptspot.com/3ds-max/scripts/speechbot
When you first time run this tool all buttons icons are created and saved on HDD.
This aproch is better (using icons from script folder) then creating them over and over again.
Cool right?
bga
edit
One more colored test script. Funny stuff you can learn here
http://www.scriptspot.com/3ds-max/scripts/ineractive-labels
Cheers!
bga