Help w/ syntax of VB command
Posted: 2016-03-03T06:11:39-07:00
I absolutely love imageMagic, I’ve been using it in some of my programs for almost 10 years now. Problem is: I only write one line of code for it every 3 to 5 years, up so I’ve never actually *learned* how to use it. I stumble through it, with a lot of cutting and pasting, and a little help from you guys.
Here’s my current problem: I have a data table with a list of file paths, and xy coordinates. (actually just X coordinates, the Y coordinate will always be 0) is my goal is to create a long strip of an image with each of these images spaced these distances apart.
The data looks like this:
Filepath, XY
c:\bmp\A.jpg 10,0
c:\bmp\B.jpg 350,0
c:\bmp\C.jpg 752,0
…
And I would loop through it with VB code to something like this:
With objImageList
.movefirst
Do while not .eof
ImgMagCmdTxt = ImgMagCmdTxt & ", " & .Filepath & ", [" & .XY & "]"
.movenext
loop
which would create the string *
"c:\bmp\A.jpg, [10,25], c:\bmp\B.jpg [10,350], c:\bmp\C.jpg, [10,752]"
which we would then use in a IM COM object command something like this:
strConvertResult = objImgMag.convert(ImgMagCmdTxt, destfilepath)
*Now I absolutely realize that is the wrong syntax for this string! But it is (I think) the data we need and it is in *a* string.
My question is: what would be the correct syntax for that string? Specifically, what about the quote marks?
The ImageMagick command line utility, and the ImageMagick COM object seem to have different requirements when it comes to quote marks, all the parameters in VB need to be in closed quote marks, but some need quote marks the inside of a quote marks, (I usually use & Chr(34) & for that). This is why the examples web page have never work for me.
To repeat: my goal is to create a long strip of an image with each of these images spaced these distances apart.
AHA, TIA ,
Roger
Here’s my current problem: I have a data table with a list of file paths, and xy coordinates. (actually just X coordinates, the Y coordinate will always be 0) is my goal is to create a long strip of an image with each of these images spaced these distances apart.
The data looks like this:
Filepath, XY
c:\bmp\A.jpg 10,0
c:\bmp\B.jpg 350,0
c:\bmp\C.jpg 752,0
…
And I would loop through it with VB code to something like this:
With objImageList
.movefirst
Do while not .eof
ImgMagCmdTxt = ImgMagCmdTxt & ", " & .Filepath & ", [" & .XY & "]"
.movenext
loop
which would create the string *
"c:\bmp\A.jpg, [10,25], c:\bmp\B.jpg [10,350], c:\bmp\C.jpg, [10,752]"
which we would then use in a IM COM object command something like this:
strConvertResult = objImgMag.convert(ImgMagCmdTxt, destfilepath)
*Now I absolutely realize that is the wrong syntax for this string! But it is (I think) the data we need and it is in *a* string.
My question is: what would be the correct syntax for that string? Specifically, what about the quote marks?
The ImageMagick command line utility, and the ImageMagick COM object seem to have different requirements when it comes to quote marks, all the parameters in VB need to be in closed quote marks, but some need quote marks the inside of a quote marks, (I usually use & Chr(34) & for that). This is why the examples web page have never work for me.
To repeat: my goal is to create a long strip of an image with each of these images spaced these distances apart.
AHA, TIA ,
Roger