How do I use VB script?
How do I use VB script?
Can someone please help a newbie out and help me understand how to use VB script with ImageMagick. How do you run the script? Do you use VBA and run it from a VBA editor like the one in Microsoft Word? I would like to use the Montage / Tile command with many files and I would like to write a script to use a number range for the file names instead of typing each individual file name.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How do I use VB script?
As this is a question about Visual Basic, I'm moving it to the Visual Basic forum. There are examples in that forum.
snibgo's IM pages: im.snibgo.com
Re: How do I use VB script?
Hi,
The basic syntax for using IM in VBScript is the following.
The "classic batch" command line parameters are separated by spaces, and to use them in VbScript, you have to enclose them as strings, as explained here :
http://www.imagemagick.org/script/ImageMagickObject.php
You use the other tools the same way :
and so on...
You will also find basic examples in the folder you have installed IM.
For example :
C:\Program Files\ImageMagick-7.0.7-Q16-HDRI\ImageMagickObject\Tests
The basic syntax for using IM in VBScript is the following.
The "classic batch" command line parameters are separated by spaces, and to use them in VbScript, you have to enclose them as strings, as explained here :
http://www.imagemagick.org/script/ImageMagickObject.php
Code: Select all
set o_objIMG = CreateObject("ImageMagickObject.MagickImage.1")
o_objIMG.Convert("c:\source.png", "-resize", "50%x25%", "c:\destination.jpg")
set o_objIMG = Nothing
Code: Select all
o_objIMG.Composite
o_objIMG.Montage
You will also find basic examples in the folder you have installed IM.
For example :
C:\Program Files\ImageMagick-7.0.7-Q16-HDRI\ImageMagickObject\Tests