1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.16: http://docutils.sourceforge.net/" />
<title>ImageMagickObject</title>
<link rel="stylesheet" href="docutils-articles.css" type="text/css" />
</head>
<body>
<div class="banner">
<img src="images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
<input type="hidden" name="domains" value="www.graphicsmagick.org" />
<input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" /> <input type="submit" name="sa" value="Search" /></span>
</form>
</div>
<div class="navmenu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="project.html">Project</a></li>
<li><a href="download.html">Download</a></li>
<li><a href="README.html">Install</a></li>
<li><a href="Hg.html">Source</a></li>
<li><a href="NEWS.html">News</a> </li>
<li><a href="utilities.html">Utilities</a></li>
<li><a href="programming.html">Programming</a></li>
<li><a href="reference.html">Reference</a></li>
</ul>
</div>
<div class="document" id="imagemagickobject">
<h1 class="title">ImageMagickObject</h1>
<!-- -*- mode: rst -*- -->
<!-- This text is in reStucturedText format, so it may look a bit odd. -->
<!-- See http://docutils.sourceforge.net/rst.html for details. -->
<div class="section" id="overview">
<h1>Overview</h1>
<p>The <em>ImageMagickObject</em> 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.</p>
<p>The strategy with the <em>ImageMagickObject</em> 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 class="reference external" href="convert.html">convert</a>, composite, <a class="reference external" href="mogrify.html">mogrify</a>, <a class="reference external" href="identify.html">identify</a>, and <a class="reference external" 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.</p>
<p><em>GraphicsMagick</em> provides a statically-built ImageMagick object as part of
its "utils" <a class="reference external" href="INSTALL-windows.html">Windows installation package</a>. When this package is
installed, <em>ImageMagickObject</em> and its sample programs are installed to</p>
<pre class="literal-block">
c:\Program Files\GraphicsMagick-1.3-Q16\ImageMagickObject
</pre>
<p>by default (path shown is for the Q:16 build). <em>ImageMagickObject</em> is
registered if the checkbox for "Register ImageMagickObject" is checked at
install time.</p>
<p>You may execute the sample program from the Windows Command Shell like:</p>
<pre class="literal-block">
cscript SimpleTest.vbs
</pre>
<p>Since the <em>GraphicsMagick</em> utility command line parsers are incorporated
within <em>ImageMagickObject</em>, please refer to the command line <a class="reference external" href="utilities.html">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.</p>
<p>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.</p>
</div>
<div class="section" id="other-goodies">
<h1>Other goodies...</h1>
<p>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 "<tt class="docutils literal">convert xxxx yyyy</tt>" you can use "<tt class="docutils literal">MagickCMD convert xxxx
yyyy</tt>" 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.</p>
</div>
<div class="section" id="building-imagemagickobject-from-source">
<h1>Building ImageMagickObject From Source</h1>
<p>The source code for <em>ImageMagickObject</em> is available from <em>GraphicsMagick</em>
CVS, or as part of the <em>GraphicsMagick</em> Windows source package. Once the
source code has been retrieved and extracted, the source for
<em>ImageMagickObject</em> may be found hidden in the directory
"<tt class="docutils literal">GraphicsMagick\contrib\win32\ATL7ImageMagickObject</tt>", however,
<em>GraphicsMagick</em> itself must be built using the "static-multithread"
(VisualStaticMT) build configuration. Building <em>ImageMagickObject</em>
requires Microsoft Visual C++ 7.0 as delivered with Microsoft's Visual
Studio .net package. See the Windows compilation instructions in order to
get <em>GraphicsMagick</em> itself built before building <em>ImageMagickObject</em>.</p>
<p>Once the VisualStaticMT project has been built, <em>ImageMagickObject</em> may
be built by following the procedure:</p>
<pre class="literal-block">
cd GraphicsMagick\contrib\win32\ATL7ImageMagickObject
BuildImageMagickObject release
</pre>
<p>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.</p>
<p>To register the DLL as a COM+ server use</p>
<pre class="literal-block">
regsvr32 /c /s ImageMagickObject.dll
</pre>
<p>To unregister the DLL use</p>
<pre class="literal-block">
regsvr32 /u /s ImageMagickObject.dll
</pre>
<p>The MagickCMD sample program operates similarly to the gm.exe program,
and is a great way to exercise <em>ImageMagickObject</em> to verify that it is
working.</p>
<p>Sometime in the future, MagickCMD may assume the place of gm.exe in the
"utils" distribution in order to decrease the overall package size.</p>
</div>
</div>
<hr class="docutils">
<div class="document">
<p><a href="Copyright.html">Copyright</a> © GraphicsMagick Group 2002 - 2022<!--SPONSOR_LOGO--></p>
</div>
</body>
</html>
|