Page 1 of 1

Image Stack syntax for COM in VB6

Posted: 2017-07-23T21:41:48-07:00
by kuhndog
How do I get the parenthesis to work in VB6 with the COM dll?
convert c:\image2.png c:\image1.png -alpha off +repage ( -clone 0 -clone 1 -compose difference -composite -threshold 0 ) ( -clone 0 -clone 2 -compose multiply -composite ) -delete 0,1 +swap -alpha off -compose copy_opacity -composite -trim +repage c:\image12diff2a.png
This above works in DOS mode but not in the VB6 code below:
Private Sub LSButton_CreateDiff_Click()

Dim img As Object
Set img = CreateObject("ImageMagickObject.MagickImage.1")


img.Convert "c:\image2.png", "c:\image1.png", "-alpha", "off", "+repage", " ( ", "-clone", 0, "-clone", 1, "-compose", "difference", "-composite", "-threshold", 0, " ) ", " ( ", "-clone", 0, "-clone", 2, "-compose", "multiply", "-composite", " ) ", "-delete", "0,1", "+swap", "-alpha", "off", "-compose", "copy_opacity", "-composite", "-trim", "+repage", "c:\MyTemp\image12diff2a.png"

Set img = Nothing
End Sub

Re: Image Stack syntax for COM in VB6

Posted: 2017-07-23T22:15:57-07:00
by fmw42
What is your IM version? Perhaps in VB6 you need to provide the full path to convert. Sorry, I am not a Windows user.