Page 1 of 1

using with VB.net 2013

Posted: 2016-03-16T11:18:03-07:00
by syoung
Is there a list of instructions to use this in a VB.net Application. Right now I am using it as a shell and the DOS screen keeps popping up and it is very slow.

Re: using with VB.net 2013

Posted: 2016-03-16T16:31:12-07:00
by markt
I just tried this simple example based on what I had in VBA using Visual Studio Community 2013, to build an x64 target, on windows 8.1 64 bit.

You need to use the 64 bit version of ImageMagick if you are creating a 64 bit application.

Only late binding seems to work, so objIM is defined as object in the example.

64 bit version is slightly faster than 32, but not sure the COM object is much faster than command line.

Code: Select all

Module Module1

    Sub main()

        Dim objIM As Object

        objIM = CreateObject(("ImageMagickObject.MagickImage.1"))

        objIM.Convert("logo:", "logo.jpg")
    End Sub
End Module
Make sure you installed the ImageMagickObject when you installed ImageMagick.

Register the ImageMagickObject.dll using regsvr32.exe from windows\system32.

Make sure the system Path environment variable includes:-
C:\Program Files\ImageMagick-6.9.3-Q16;

Also had to change two other environment variables that had been set by a recently installed utility:-
MAGICK_CODER_MODULE_PATH
C:\Program Files\ImageMagick-6.9.3-Q16\modules\coders

MAGICK_FILTER_MODULE_PATH
C:\Program Files\ImageMagick-6.9.3-Q16\modules\filters