Image Stack syntax for COM in VB6

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
kuhndog
Posts: 1
Joined: 2017-07-23T21:30:30-07:00
Authentication code: 1151

Image Stack syntax for COM in VB6

Post by kuhndog » 2017-07-23T21:41:48-07:00

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

User avatar
fmw42
Posts: 22081
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Image Stack syntax for COM in VB6

Post by fmw42 » 2017-07-23T22:15:57-07:00

What is your IM version? Perhaps in VB6 you need to provide the full path to convert. Sorry, I am not a Windows user.

Post Reply