Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7080191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:45:53+00:00 2026-05-28T06:45:53+00:00

I have successfully used the following command line to create a new GIF image

  • 0

I have successfully used the following command line to create a new GIF image with some simple text

convert -size 100x100 -font arial label:blah output.gif

I would like to achieve the same result using the COM interface from VBScript, but have not been successful in passing in the same parameters in. Here is my code…

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:\temp\example.gif"

retval = img.convert(fnm)

wscript.echo("retval " & retval)

I execute this code as follows

cscript example.vbs

and the output I get is this, and no GIF file is created…

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 on Windows7 using ImageMagick-6.7.4-Q16

Does anyone know what I am doing wrong?

[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:\temp\blank.gif", "-size", "100x100", "-font", "arial", "label:", "blah", "C:\temp\example.gif")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:45:54+00:00Added an answer on May 28, 2026 at 6:45 am

    In the end I gave up trying to get label to work when using the COM+ API and have a solution that uses -draw instead. Ekkehard was right about not using an Array, and instead use individual arguments as shown below.

    msgs = img.convert( "c:\temp\blank.gif", "-font", "arial", "-pointsize", "36", "-gravity", "center", "-fill", "blue", "-draw", "text 0,0 'blah'", "c:\temp\example.gif")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used to have this kind of simple JSON data and I could successfully
The following C# code is used in a service I have inherited, to convert
I have a module called spellnum . It can be used as a command-line
I have successfully created the message queue by using the following command: msgIdHareTurtle =
I have successfully changed MKAnnotationView to use my custom image with the following code
I have successfully used the Excel and Word addin templates in Visual studio 2008
I need to used dynamic order query in mysql and i have successfully achieved
I have used java mail(com.sun.mail.smtp) from my struts project. Mail is sent successfully but
I have successfully managed to get System.Speech.Synthesis to read English text in arbitrary voices
I have created an sqlite table using the following statement: CREATE TABLE IF NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.