ravenous opened this issue on Dec 10, 2011 · 60 posts
lmckenzie posted Thu, 15 December 2011 at 9:02 PM
Gflax.dll: http://www.xnview.com/en/download_gfl.html
download the GFLAx (ActiveX/ASP component) light v2.80 zip file
you should only need the Gflax.dll from the GflAxLiblight folder
'--------------------------------------------
' Overlay.vbs
' Requires an overlay image named overlay.psd
' Outputs overlaid image named composite.jpg
' Overlay & base image dimensions must match e.g. 2000x2000
' Put GflAx.dll in a folder of your choice
' Register GflAx.dll
' Paste Script into notepad
' Change Z:Overlay in strFolder = "Z:Overlay" to your Drive:Folder
' Save script as overlay.vbs in folder with GflAx.dll
' Place a .psd (with alpha) file named Overlay.psd in same folder
' Drag and drop a .jpg image onto overlay.vbs icon
'--------------------------------------------
'<< Start of Script >>
Dim objGFL
Dim objArgs
Dim strBaseImage
Dim strFolder
Set objArgs = WScript.Arguments
Set objGFL = CreateObject("GflAx.GflAx")
objGFL.SaveFormat = 1 'Save as jpeg
objGFL.SaveJPEGQuality = 100 'Maximum Quality
strBaseImage = objArgs(0)
Set objArgs = Nothing
strFolder = "Z:OverLay"
objGFL.LoadBitmap strBaseImage 'Base Image
objGFL.drawimage strFolder & "Overlay.psd", 0, 0 'Overlay Image
objGFL.SaveBitmap strFolder & "Composite.jpg" 'Composite Image
MsgBox "Composite.jpg Saved",vbOkOnly,"Done!"
Set objGFL = Nothing
'<< End of Script >>
'-------------------
'How To Register dll
'I'd do a search 1st in case the dll is already on your system
'-------------------
'From a command prompt type:
'regsvr32 Z:OverlayGflAx.dll (Change Z:Overlay to proper folder)
'-
'To unregister it:
'regsvr32/u Z:OverlayGflAx.dll (Change Z:Overlay to proper folder)
'--------------
The library provides a host of image processing functions, enough to create your own mini Photoshop, plus in the forums it was announced that it can be used freely even for commercial projects. vbScript doesn't provide any way to see the images, but it works fine for this sort of thing and doesn't require an .exe. Use VB, C++ etc. for something more complex. There are Mac and Linux versions but AFAIK, only the Windows ActiveX version is free for commercial use.
"Democracy is a pathetic belief in the collective wisdom of individual ignorance." - H. L. Mencken