I wonder how to use the feature that's shown in ArrayTest.vbs, which passes an array by reference used as output parameter.
I tried COMARRAY(), but that didn't help
The script itself works, when you open up cmd.com, change to the ImageMagickObject\Tests directory and then do
C:\Windows\syswow64\wscript ArrayTest.vbs
The OLE registration is okay, I can do thiss without error, too:
Code:
loImage = CreateObject("ImageMagickObject.MagickImage.1")
COMARRAY(loImage,10)
Local Array myarray[3000000]
msgs = loImage.Convert("null:","-profile","8BIMTEXT:iptctext.txt",myarray)
? msgs
? Alen(myarray)
? myarray[1]
msgs is 1,1,NULL, the array doesn't change at all.
I think one problem in comparison with executing the vbs script is, that the ImageMagicObject isn't working in the Tests directory and when I C into it in the VFP code, that doesn't change the current directory for the ImageMagicObject. So I also tried with the fullpath to the ipctext.txt and that fails, too.
It's not even the most important part of the sample code, as it only loads some iptc definitions, which then are added to a jpeg file that is unchanged otherwise.
In general ImageMagick would return a blob of the image in an array, and VFP might be able to display that as PictureVal. I also tried to use a string instead of array, but the call doesn't like that at all.
What can be done is something like a file conversion by loImage.Convert(cImageSourceFile,cImageDestinationFile), for example
Code:
loImage = CreateObject("ImageMagickObject.MagickImage.1")
loImage.convert("bill_meets_gorilla_screen.jpg","bill_meets_gorilla_screen.png")
Which also means the ImageMagicObject looks into the Tests folder that contains the bill_meets_gorilla_screen.jpg.
I see
has some basic samples to do other things, but what about the array feature? Tom, did you ever work with that?
What I am after is being able to load a format VFP doesn't support, like webp or DICOM and load it into an array in png format that an image control can display, without writing a png file first.
Chriss