我成功地利用了以下指挥线,以制作带有一些简单文字的新的全球投资论坛形象。
convert -size 100x100 -font arial label:blah output.gif
我愿利用VB文本的COM接口取得同样的结果,但未能成功地通过同样的参数。 我的守则......
Dim img
Set img = CreateObject("ImageMagickObject.MagickImage.1")
Dim fnm(6)
fnm(0) = "-size"
fnm(1) = "100x100"
fnm(2) = "-font"
fnm(3) = "arial"
fnm(4) = "-label"
fnm(5) = "blah"
fnm(6) = "C: empexample.gif"
retval = img.convert(fnm)
wscript.echo("retval " & retval)
我执行以下守则:
cscript example.vbs
而我获得的产出是这样,没有建立全球投资论坛档案。
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Version: ImageMagick 6.7.4-3 2011-12-24 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
Usage: cscript.exe [options ...] file [ [options ...] file ...] [options ...] file
I m 视窗7使用图像Magick-6.7.4-Q16
是否有任何人知道我做了什么错误?
[Edit]
In response to Ekkehard s answer I have also tried not using an array. This code will create an output image, but the label
is not applied. I also have to pass in a white image as an input as it will not work without one.
msgs = img.convert("C: emplank.gif", "-size", "100x100", "-font", "arial", "label:", "blah", "C: empexample.gif")