<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1"> <TITLE>GraphicsMagick ImageMagickObject</TITLE> <META NAME="GENERATOR" CONTENT="StarOffice 7 (Solaris Sparc)"> <META NAME="CREATED" CONTENT="20020823;18090800"> <META NAME="CHANGEDBY" CONTENT="Robert Friesenhahn"> <META NAME="CHANGED" CONTENT="20040418;19105600"> <META NAME="CLASSIFICATION" CONTENT="Description of ImageMagickObject as delivered with GraphicsMagick "> <META NAME="DESCRIPTION" CONTENT="GraphicsMagick is a robust collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats including GIF, JPEG, PNG, PDF, and Photo CD. With GraphicsMagick you can create GIFs dynamically making it suitable for Web applications. You can also resize, rotate, sharpen, color reduce, or add special effects to an image and save your completed work in the same or differing image format."> <META NAME="KEYWORDS" CONTENT="GraphicsMagick, Image Magick, Image Magic, PerlMagick, Perl Magick, Perl Magic, CineMagick, PixelMagick, Pixel Magic, WebMagick, Web Magic, visualization, image processing, software development, simulation, image, software, AniMagick, Animagic, Magick++"> <STYLE> <!-- @page { size: 8.5in 11in } TD P { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt } P { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt } PRE { color: #000000 } A:link { color: #0085c0 } A:visited { color: #800080 } --> </STYLE> </HEAD> <BODY LANG="en-US" TEXT="#000000" LINK="#0085c0" VLINK="#800080" BGCOLOR="#ffffff" DIR="LTR"> <P STYLE="margin-bottom: 0in"><BR> </P> <TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=2> <TR> <TD BGCOLOR="#52799e"> <P><IMG SRC="../images/right_triangle.png" NAME="Graphic2" ALT=">" ALIGN=BOTTOM WIDTH=15 HEIGHT=14 BORDER=0> <B><FONT FACE="Helvetica, Arial"><FONT COLOR="#ffffff">ImageMagickObject Overview</FONT></FONT></B></P> </TD> </TR> </TABLE> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>The ImageMagickObject is a COM+ compatible component that may 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 can also be used from C++, ASP, and other languages like Delphi, Perl and PHP.</FONT></FONT></P> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri">The strategy with the ImageMagickObject COM+ component is not to the same as with PerlMagick interface provided with ImageMagick. PerlMagick is a low level API based system that defines a whole new way of scripting IM operations. The IM COM+ component simply provides access to the <A HREF="convert.html">convert</A>, <A HREF="composite.html">composite</A>, <A HREF="mogrify.html">mogrify</A>, <A HREF="identify.html">identify</A>, and <A HREF="montage.html">montage</A> 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.</FONT></P> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri">GraphicsMagick provides a statically-built ImageMagick object as part of its "utils" <A HREF="INSTALL-windows.html">Windows installation package</A>. When this package is installed, ImageMagickObject and its sample programs are installed to</FONT></P> <PRE STYLE="margin-bottom: 0.2in"> c:\Program Files\GraphicsMagick-1.0-Q16\ImageMagickObject</PRE><P> <FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>by default (path shown is for the Q:16 build). ImageMagickObject is registered if the checkbox for "Register ImageMagickObject" is checked at install time.</FONT></FONT></P> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>You may execute the sample program from the Windows Command Shell like:</FONT></FONT></P> <PRE STYLE="margin-bottom: 0.2in"> cscript SimpleTest.vbs</PRE><P> <FONT FACE="Verdana, Arial, Helvetica, sans-seri">Since the ImageMagick utility command line parsers are incorporated within ImageMagickObject, please refer to the <A HREF="utilities.html">command line utility documentation</A> to learn how to use it. The sample VBS scripts show how the object should be called and used and have lots of comments.</FONT></P> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>For C++ programmers - have a look at the MagickCMD.cpp command line utility for an example of how to call the object from C++. This is a bit complex because 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.</FONT></FONT></P> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>Other goodies...</FONT></FONT></P> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>MagickCMD is a C++ sample, but it can also server 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 the job done. This small tight combination replaces the entire usual binary distribution in just a few megabytes.</FONT></FONT></P> <TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=2> <TR> <TD BGCOLOR="#52799e"> <P><IMG SRC="../images/right_triangle.png" NAME="Graphic2" ALT=">" ALIGN=BOTTOM WIDTH=15 HEIGHT=14 BORDER=0> <B><FONT FACE="Helvetica, Arial"><FONT COLOR="#ffffff">Building ImageMagickObject From Source</FONT></FONT></B></P> </TD> </TR> </TABLE> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri">The source code for ImageMagickObject is available from <A HREF="cvs.html">GraphicsMagick CVS</A>, or as part of the <A HREF="download.html">GraphicsMagick Windows source package</A>. Once the source code has been retrieved and extracted, the source for ImageMagickObject may be found hidden in the directory "GraphicsMagick\contrib\win32\ATL7ImageMagickObject", however, GraphicsMagick 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 <A HREF="INSTALL-windows.html">Windows compilation instructions</A> in order to get GraphicsMagick itself built before building ImageMagickObject.</FONT></P> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>Once the VisualStaticMT project has been built, ImageMagickObject may be built by following the procedure:</FONT></FONT></P> <PRE> cd GraphicsMagick\contrib\win32\ATL7ImageMagickObject BuildImageMagickObject release</PRE><P> <FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>This procedure assumes 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, then specify the argument "debug" instead.</FONT></FONT></P> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>To register the DLL as a COM+ server use</FONT></FONT></P> <PRE STYLE="margin-bottom: 0.2in"> regsvr32 /c /s ImageMagickObject.dll</PRE><P> <FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>To unregister the DLL use</FONT></FONT></P> <PRE STYLE="margin-bottom: 0.2in"> regsvr32 /u /s ImageMagickObject.dll</PRE><P> <FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>The MagickCMD sample program operates similarly to the gm.exe program, and is a great way to exercise ImageMagickObject to verify that it is working.</FONT></FONT></P> <P><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><FONT SIZE=3>Sometime in the future, it is expected that MagickCMD will assume the place of gm.exe in the "utils" distribution in order to decrease the overall package size.</FONT></FONT></P> <HR> <P ALIGN=CENTER><FONT FACE="Verdana, Arial, Helvetica, sans-seri"><A HREF="Copyright.html">Copyright</A> <FONT FACE="Abadi Mt Condensed Extra Bold">©</FONT> GraphicsMagick Group 2002, 2003, 2004</FONT></P> </BODY> </HTML>