ImageMagickObject: result empty or SafeArrayTypeMismatch

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
dare

ImageMagickObject: result empty or SafeArrayTypeMismatch

Post by dare »

Greetings,

I'm one more trying to use the ImageMagickObject in Visual Basic (using Visual Studio 2008). And I am despairing in getting the image out again after IM is done with it. At the moment, my choice is between receiving literally "Nothing" or a SafeArrayTypeMismatchException. The former achievement I got with:

Code: Select all

Dim image As New MagickImage ' (with the appropriate link)
Dim Bild(1), msgs
Bild(0) = "JPG:"
msgs = image.Convert("logo:", Bild)
This runs smoothly, and msgs is a string with "640,480,JPG" in it afterwards - only that Bild contains nothing more than the one string element with "JPG:" as value.

If I try late binding instead as in ArrayTest.vbs, that is:

Code: Select all

Dim Bild(1), msgs
Dim img

img = CreateObject("ImageMagickObject.MagickImage.1")
Bild(0) = "JPG:"
msgs = img.Convert("logo:", Bild)
I receive a SafeArrayTypeMismatchException when calling img.convert, and even with everything I tried out to set Bild(1) to before calling (e.g. to object()) I couldn't get it running.

So an idea how to get an image back out of IM (without writing it to disk) anyone? Seems the other questions on the board here were unresolved and all other searches yielded no result as well.

Thanks for your help,

Daniel
Post Reply