Wont Load PNG image in rollout dialog

Hello all. Im not programmer or script writer, but need help some scripting in maxscript. I tryng made simple scene loader with image previews with png imge, but png not load in the rollout box. Is there someone, who can correct my script?

Script itself is…

rollout rollScenes "Stuudios One" width:670 height:132
	(
	groupBox gr_smallsc "Stuudiod üks" pos:[0,0] width:669 height:131
 
	dotNetControl sceneTh_S1 "System.Windows.Forms.PictureBox" pos:[6,20] width:130 height:98
 
	on sceneTh_S1 DoubleClick arg do 
	(
 
			loadMaxFile ((getDir #maxroot) + "\\scripts\\Studios\\Studio1.max") useFileUnits:true quiet:true;
			max file saveas
 
	)	
	fn fillScenesTh =
	(
	sceneTh_S1.Image = sceneTh_S1.FromFile ((getDir #maxroot) + "\\scripts\\Studios\\Studio1.png")
	)
 
)
 
createdialog rollScenes

Script is little messed and one more time, im not expert this stuff, but there is someting wrong. Thanks for help.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

Try this:

(
	rollout rollScenes "Stuudios One" width:670 height:132
	(
 
		local ImageClass = dotnetclass "system.drawing.image"
 
		groupBox gr_smallsc "Stuudiod üks" pos:[0,0] width:669 height:131
 
		dotNetControl sceneTh_S1 "System.Windows.Forms.PictureBox" pos:[6,20] width:130 height:98
 
		on sceneTh_S1 DoubleClick arg do 
		(
			sceneTh_S1.Image = ImageClass.FromFile ((getDir #maxroot) + "\\scripts\\Studios\\Studio1.png")
 
			loadMaxFile ((getDir #maxroot) + "\\scripts\\Studios\\Studio1.max") useFileUnits:true quiet:true;
			max file saveas	 
		) 
	)
 	createdialog rollScenes
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.