Does Maxscript have the ability to overlay a transparent PNG on top of another image, like a stamp or such?
Forum topic · General Scripting
Combining or overlaying images through script?
By Haider Alghifary · 2016-02-20
New forum topics are on pause. Signed-in members can reply to existing topics. Contact ScriptSpot if you need help.
Comments (3)
Comment policy
With .NET...
I am sure you can do this task with the native Maxscript functions, but at the moment I can give you a hint with .NET. I hope can recall correct...
At first create graphics class:
g = dotnetclass "system.drawing.graphics"
Then create a new bitmap or from file such as:
b = dotnetobject "system.drawing.bitmap" 256 256
Or... b = (dotnetclass "system.drawing.image").fromfile "c:\\myImage.bmp"
Next create the graphics inherited object:
gfi = g.fromimage b
Now you can paint over this image using the graphics object gfi.
gfi.drawimage "c:\\myStamp.png"
....
Just examine the graphics drawing methods in the Listener: showmethods gfi.
There are many drawing methods. You should be able to specify the x, y coordinates, maybe with this method, just take a look.
To be clear
use b.save "c:\\myImage.bmp" to save the file.
.
I got the help I needed on CGTalk (credits goes to Jorge Rodríguez, PolyTools3D), and the solution looks like this: