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)
)
barigazy · 2013-03-17