ImageMagick: Install the ImageMagickObject COM+ Component
Author: ImageMagick Studio LLC
Description: ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems. The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (P [cell cut: 1167 characters, first 1000 kept]
Keywords: install, the, imagemagickobject, com+, component, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand

## Introduction to the ImageMagick COM+ Object The ImageMagickObject is a COM+ compatible component that can be invoked from any language capable of using COM objects. The intended use is for Windows Scripting Host VBS scripts and Visual Basic, but it is also available from to C++, ASP, and other languages like Delphi, Perl and PHP. The ImageMagick COM+ component provides access to the compare, convert, composite, mogrify, identify, montage, and stream tools, efficiently executing them as part of your process, rather than as external programs. The way you use it is exactly the same. You pass it a list of strings including filenames and various options and it does the job. In fact, you can take any existing batch scripts that use the command line tools and translate them into the equivalent calls to the COM+ object in a matter of minutes. Beyond that, there is also a way to pass in and retrieve images in memory in the form of standard smart arrays (byte arrays). Samples are provided, to show both the simple and more elaborate forms of access. ImageMagick provides a statically-built ImageMagick object as part of its Windows installation package. When this package is installed, ImageMagickObject and its sample programs are installed as well.
      c:\Program Files\ImageMagick-6.?-?-Q16\ImageMagickObject
by default (path shown is for the Q:16 build). ImageMagickObject is registered if the checkbox, `Register ImageMagickObject`, is checked at install time. To execute the sample program from the Windows Command Shell, type:
      cscript SimpleTest.vbs
Since the ImageMagick utility command line parsers are incorporated within ImageMagickObject, please refer to the command-line tools discussion to learn how to use it. The sample VBS scripts show how the object should be called and used and have lots of comments. For C++ programmers - have a look at the `MagickCMD.cpp` command line utility for an example of how to call the object from C++. The object requires a variable size list of BSTR's to emulate the command line argc, argv style calling conventions of the COM component which is more complex in C++ then in VBS or VB. MagickCMD is a C++ sample, but it also serves as a replacement for all the other command line utilities in most applications. Instead of using `convert xxxx yyyy` you can use `MagickCMD convert xxxx yyyy` instead. MagickCMD calls the COM object to get accomplish the designated task. This small tight combination replaces the entire usual binary distribution in just a few megabytes. ## Build ImageMagickObject From Source The source code for ImageMagickObject is available from the ImageMagick subversion repository, or as part of the Windows source distribution. Once the source code has been retrieved and extracted, the source for ImageMagickObject is the directory `ImageMagick\contrib\win32\ATL7ImageMagickObject`, however, ImageMagick itself must be built using the static-multithread (VisualStaticMT) build configuration. Building ImageMagickObject requires Microsoft Visual C++ 7.0 as delivered with Microsoft's Visual Studio .NET package. See the Windows compilation instructions to get ImageMagick itself built before building the ImageMagick COM+ component. Once the VisualStaticMT project has been built, build the ImageMagickObject with this procedure:
      cd  ImageMagick\contrib\win32\ATL7ImageMagickObject
      BuildImageMagickObject release
Here, we assume that the VisualStaticMT project has been built using the release setting for an optimized build. If the debug setting was used for a debug build, specify the argument `debug`; instead. To register the DLL as a COM+ server, type
      regsvr32 /c /s ImageMagickObject.dll
To unregister the DLL, type
      regsvr32 /u /s ImageMagickObject.dll
Use MagickCMD to exercise ImageMagickObject to verify that it is working properly. |

Discourse Server • Mailing Lists • ImageMagick Studio