VB Interface and Capturing STDERR

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
billbell52

VB Interface and Capturing STDERR

Post by billbell52 »

The compare command outputs the location info to STDERR. So the command line below works perfectly. The location info goes into loc.txt (2> sends STDERR to loc.txt). I have coded this up to use the windows shell command and it runs perfectly.

compare -metric rmse -dissimilarity-threshold 1 c:\temp\main.bmp c:\temp\sub.bmp c:\result.bmp 2>c:\temp\loc.txt

I want to test using the windows shell approach to using the VB interface. I am using VBA in Excel. The code below works but I have no clue how to get STDERR. Everything I have tried has not worked. Any ideas?

Sub TestCompare()

Dim imgObj As Object
Dim loc As Variant
Dim mainImage As String
Dim subImage As String
Dim resultImage As String

mainImage = "C:\temp\main.bmp"
subImage = "C:\temp\sub.bmp"
resultImage = "C:\temp\result.bmp"

Set imgObj = CreateObject("ImageMagickObject.MagickImage.1")
loc = imgObj.Compare("-metric", "rmse", "-dissimilarity-threshold", "1", mainImage, subImage, resultImage)
Set imgObj = Nothing
End Sub
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: VB Interface and Capturing STDERR

Post by snibgo »

You are asking a Visual Basic question on an ImageMagick forum. I don't know the answer, but an internet search turns up many possibilities.
snibgo's IM pages: im.snibgo.com
billbell52

Re: VB Interface and Capturing STDERR

Post by billbell52 »

It is the DLL provided with the ImageMagick Windows binary. It is a question on the dll not VBA. I am not sure who provides the dll for the ImageMagick binary Windows install. I did tons of googling and could not find an answer.
Post Reply