8 <meta charset="utf-8" />
9 <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no" />
10 <title>MagickWand, C API: Wand Methods @ ImageMagick</title>
11 <meta name="application-name" content="ImageMagick" />
12 <meta name="description" content="ImageMagick® creates, edits, composes, and converts bitmap images. Resize an image, crop it, change its shades and colors, add captions, and more." />
13 <meta name="application-url" content="https://imagemagick.org" />
14 <meta name="generator" content="PHP" />
15 <meta name="keywords" content="magickwc, api:, wmethods, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert" />
16 <meta name="rating" content="GENERAL" />
17 <meta name="robots" content="INDEX, FOLLOW" />
18 <meta name="generator" content="ImageMagick Studio LLC" />
19 <meta name="author" content="ImageMagick Studio LLC" />
20 <meta name="revisit-after" content="2 DAYS" />
21 <meta name="resource-type" content="document" />
22 <meta name="copyright" content="Copyright (c) 1999-2019 ImageMagick Studio LLC" />
23 <meta name="distribution" content="Global" />
24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25 <meta property='og:url' content='../../' />
26 <meta property='og:title' content='ImageMagick' />
27 <meta property='og:image' content='../../images/logo.png' />
28 <meta property='og:type' content='website' />
29 <meta property='og:site_name' content='ImageMagick' />
30 <meta property='og:description' content="Convert, Edit, or Compose Bitmap Images" />
31 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
32 <link href="magick-wand.html" rel="canonical" />
33 <link href="../images/wand.png" rel="icon" />
34 <link href="../images/wand.ico" rel="shortcut icon" />
35 <link href="assets/magick.css" rel="stylesheet" />
39 <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
40 <a class="navbar-brand" href="../index.html"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a>
41 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
42 <span class="navbar-toggler-icon"></span>
45 <div class="navbar-collapse collapse" id="navbarsMagick" style="">
46 <ul class="navbar-nav mr-auto">
47 <li class="nav-item ">
48 <a class="nav-link" href="montage.html">Home <span class="sr-only">(current)</span></a>
50 <li class="nav-item ">
51 <a class="nav-link" href="../www/download.html">Download</a>
53 <li class="nav-item ">
54 <a class="nav-link" href="../www/command-line-tools.html">Tools</a>
56 <li class="nav-item ">
57 <a class="nav-link" href="../www/command-line-processing.html">Command-line</a>
59 <li class="nav-item ">
60 <a class="nav-link" href="../www/resources.html">Resources</a>
62 <li class="nav-item ">
63 <a class="nav-link" href="../www/develop.html">Develop</a>
66 <a class="nav-link" target="_blank" href="../https://imagemagick.org/discourse-server//">Community</a>
69 <form class="form-inline my-2 my-lg-0" action="../https://imagemagick.org/script/search.php">
70 <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
71 <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
75 <div class="container">
76 <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
78 data-ad-client="ca-pub-3129977114552745"
79 data-ad-slot="6345125851"
80 data-ad-format="auto"></ins>
82 (adsbygoogle = window.adsbygoogle || []).push({});
87 <main class="container">
88 <div class="magick-template">
89 <div class="magick-header">
90 <p class="text-center"><a href="magick-wand.html#ClearMagickWand">ClearMagickWand</a> • <a href="magick-wand.html#CloneMagickWand">CloneMagickWand</a> • <a href="magick-wand.html#DestroyMagickWand">DestroyMagickWand</a> • <a href="magick-wand.html#IsMagickWand">IsMagickWand</a> • <a href="magick-wand.html#MagickClearException">MagickClearException</a> • <a href="magick-wand.html#MagickGetException">MagickGetException</a> • <a href="magick-wand.html#MagickGetExceptionType">MagickGetExceptionType</a> • <a href="magick-wand.html#MagickGetIteratorIndex">MagickGetIteratorIndex</a> • <a href="magick-wand.html#MagickQueryConfigureOption">MagickQueryConfigureOption</a> • <a href="magick-wand.html#MagickQueryConfigureOptions">MagickQueryConfigureOptions</a> • <a href="magick-wand.html#MagickQueryFontMetrics">MagickQueryFontMetrics</a> • <a href="magick-wand.html#MagickQueryMultilineFontMetrics">MagickQueryMultilineFontMetrics</a> • <a href="magick-wand.html#MagickQueryFonts">MagickQueryFonts</a> • <a href="magick-wand.html#MagickQueryFormats">MagickQueryFormats</a> • <a href="magick-wand.html#MagickRelinquishMemory">MagickRelinquishMemory</a> • <a href="magick-wand.html#MagickResetIterator">MagickResetIterator</a> • <a href="magick-wand.html#MagickSetFirstIterator">MagickSetFirstIterator</a> • <a href="magick-wand.html#MagickSetIteratorIndex">MagickSetIteratorIndex</a> • <a href="magick-wand.html#MagickSetLastIterator">MagickSetLastIterator</a> • <a href="magick-wand.html#MagickWandGenesis">MagickWandGenesis</a> • <a href="magick-wand.html#MagickWandTerminus">MagickWandTerminus</a> • <a href="magick-wand.html#NewMagickWand">NewMagickWand</a> • <a href="magick-wand.html#NewMagickWandFromImage">NewMagickWandFromImage</a> • <a href="magick-wand.html#IsMagickWandInstantiated">IsMagickWandInstantiated</a></p>
92 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="ClearMagickWand">ClearMagickWand</a></h2>
94 <p>ClearMagickWand() clears resources associated with the wand, leaving the wand blank, and ready to be used for a new set of images.</p>
96 <p>The format of the ClearMagickWand method is:</p>
99 void ClearMagickWand(MagickWand *wand)
102 <p>A description of each parameter follows:</p>
108 <dl class="dl-horizontal">
110 <dd>the magick wand. </dd>
114 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="CloneMagickWand">CloneMagickWand</a></h2>
116 <p>CloneMagickWand() makes an exact copy of the specified wand.</p>
118 <p>The format of the CloneMagickWand method is:</p>
121 MagickWand *CloneMagickWand(const MagickWand *wand)
124 <p>A description of each parameter follows:</p>
130 <dl class="dl-horizontal">
132 <dd>the magick wand. </dd>
136 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="DestroyMagickWand">DestroyMagickWand</a></h2>
138 <p>DestroyMagickWand() deallocates memory associated with an MagickWand.</p>
140 <p>The format of the DestroyMagickWand method is:</p>
143 MagickWand *DestroyMagickWand(MagickWand *wand)
146 <p>A description of each parameter follows:</p>
152 <dl class="dl-horizontal">
154 <dd>the magick wand. </dd>
158 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="IsMagickWand">IsMagickWand</a></h2>
160 <p>IsMagickWand() returns MagickTrue if the wand is verified as a magick wand.</p>
162 <p>The format of the IsMagickWand method is:</p>
165 MagickBooleanType IsMagickWand(const MagickWand *wand)
168 <p>A description of each parameter follows:</p>
174 <dl class="dl-horizontal">
176 <dd>the magick wand. </dd>
180 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickClearException">MagickClearException</a></h2>
182 <p>MagickClearException() clears any exceptions associated with the wand.</p>
184 <p>The format of the MagickClearException method is:</p>
187 MagickBooleanType MagickClearException(MagickWand *wand)
190 <p>A description of each parameter follows:</p>
196 <dl class="dl-horizontal">
198 <dd>the magick wand. </dd>
202 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickGetException">MagickGetException</a></h2>
204 <p>MagickGetException() returns the severity, reason, and description of any error that occurs when using other methods in this API.</p>
206 <p>The format of the MagickGetException method is:</p>
209 char *MagickGetException(const MagickWand *wand,ExceptionType *severity)
212 <p>A description of each parameter follows:</p>
218 <dl class="dl-horizontal">
220 <dd>the magick wand. </dd>
224 <dd>the severity of the error is returned here. </dd>
228 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickGetExceptionType">MagickGetExceptionType</a></h2>
230 <p>MagickGetExceptionType() returns the exception type associated with the wand. If no exception has occurred, UndefinedExceptionType is returned.</p>
232 <p>The format of the MagickGetExceptionType method is:</p>
235 ExceptionType MagickGetExceptionType(const MagickWand *wand)
238 <p>A description of each parameter follows:</p>
244 <dl class="dl-horizontal">
246 <dd>the magick wand. </dd>
250 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickGetIteratorIndex">MagickGetIteratorIndex</a></h2>
252 <p>MagickGetIteratorIndex() returns the position of the iterator in the image list.</p>
254 <p>The format of the MagickGetIteratorIndex method is:</p>
257 ssize_t MagickGetIteratorIndex(MagickWand *wand)
260 <p>A description of each parameter follows:</p>
266 <dl class="dl-horizontal">
268 <dd>the magick wand. </dd>
272 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickQueryConfigureOption">MagickQueryConfigureOption</a></h2>
274 <p>MagickQueryConfigureOption() returns the value associated with the specified configure option.</p>
276 <p>The format of the MagickQueryConfigureOption function is:</p>
279 char *MagickQueryConfigureOption(const char *option)
282 <p>A description of each parameter follows:</p>
288 <dl class="dl-horizontal">
290 <dd>the option name. </dd>
294 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickQueryConfigureOptions">MagickQueryConfigureOptions</a></h2>
296 <p>MagickQueryConfigureOptions() returns any configure options that match the specified pattern (e.g. "*" for all). Options include NAME, VERSION, LIB_VERSION, etc.</p>
298 <p>The format of the MagickQueryConfigureOptions function is:</p>
301 char **MagickQueryConfigureOptions(const char *pattern,
302 size_t *number_options)
305 <p>A description of each parameter follows:</p>
311 <dl class="dl-horizontal">
313 <dd>Specifies a pointer to a text string containing a pattern. </dd>
316 <dt>number_options</dt>
317 <dd> Returns the number of configure options in the list. </dd>
323 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickQueryFontMetrics">MagickQueryFontMetrics</a></h2>
325 <p>MagickQueryFontMetrics() returns a 13 element array representing the following font metrics:</p>
329 -------------------------------------------------
336 6 maximum horizontal advance
345 <p>The format of the MagickQueryFontMetrics method is:</p>
348 double *MagickQueryFontMetrics(MagickWand *wand,
349 const DrawingWand *drawing_wand,const char *text)
352 <p>A description of each parameter follows:</p>
358 <dl class="dl-horizontal">
360 <dd>the Magick wand. </dd>
363 <dt>drawing_wand</dt>
364 <dd>the drawing wand. </dd>
372 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickQueryMultilineFontMetrics">MagickQueryMultilineFontMetrics</a></h2>
374 <p>MagickQueryMultilineFontMetrics() returns a 13 element array representing the following font metrics:</p>
378 -------------------------------------------------
385 6 maximum horizontal advance
394 <p>This method is like MagickQueryFontMetrics() but it returns the maximum text width and height for multiple lines of text.</p>
396 <p>The format of the MagickQueryFontMetrics method is:</p>
399 double *MagickQueryMultilineFontMetrics(MagickWand *wand,
400 const DrawingWand *drawing_wand,const char *text)
403 <p>A description of each parameter follows:</p>
409 <dl class="dl-horizontal">
411 <dd>the Magick wand. </dd>
414 <dt>drawing_wand</dt>
415 <dd>the drawing wand. </dd>
423 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickQueryFonts">MagickQueryFonts</a></h2>
425 <p>MagickQueryFonts() returns any font that match the specified pattern (e.g. "*" for all).</p>
427 <p>The format of the MagickQueryFonts function is:</p>
430 char **MagickQueryFonts(const char *pattern,size_t *number_fonts)
433 <p>A description of each parameter follows:</p>
439 <dl class="dl-horizontal">
441 <dd>Specifies a pointer to a text string containing a pattern. </dd>
444 <dt>number_fonts</dt>
445 <dd> Returns the number of fonts in the list. </dd>
451 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickQueryFormats">MagickQueryFormats</a></h2>
453 <p>MagickQueryFormats() returns any image formats that match the specified pattern (e.g. "*" for all).</p>
455 <p>The format of the MagickQueryFormats function is:</p>
458 char **MagickQueryFormats(const char *pattern,size_t *number_formats)
461 <p>A description of each parameter follows:</p>
467 <dl class="dl-horizontal">
469 <dd>Specifies a pointer to a text string containing a pattern. </dd>
472 <dt>number_formats</dt>
473 <dd> This integer returns the number of image formats in the list. </dd>
477 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickRelinquishMemory">MagickRelinquishMemory</a></h2>
479 <p>MagickRelinquishMemory() relinquishes memory resources returned by such methods as MagickIdentifyImage(), MagickGetException(), etc.</p>
481 <p>The format of the MagickRelinquishMemory method is:</p>
484 void *MagickRelinquishMemory(void *resource)
487 <p>A description of each parameter follows:</p>
493 <dl class="dl-horizontal">
495 <dd>Relinquish the memory associated with this resource. </dd>
499 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickResetIterator">MagickResetIterator</a></h2>
501 <p>MagickResetIterator() resets the wand iterator.</p>
503 <p>It is typically used either before iterating though images, or before calling specific functions such as MagickAppendImages() to append all images together.</p>
505 <p>Afterward you can use MagickNextImage() to iterate over all the images in a wand container, starting with the first image.</p>
507 <p>Using this before MagickAddImages() or MagickReadImages() will cause new images to be inserted between the first and second image.</p>
509 <p>The format of the MagickResetIterator method is:</p>
512 void MagickResetIterator(MagickWand *wand)
515 <p>A description of each parameter follows:</p>
521 <dl class="dl-horizontal">
523 <dd>the magick wand. </dd>
527 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickSetFirstIterator">MagickSetFirstIterator</a></h2>
529 <p>MagickSetFirstIterator() sets the wand iterator to the first image.</p>
531 <p>After using any images added to the wand using MagickAddImage() or MagickReadImage() will be prepended before any image in the wand.</p>
533 <p>Also the current image has been set to the first image (if any) in the Magick Wand. Using MagickNextImage() will then set teh current image to the second image in the list (if present).</p>
535 <p>This operation is similar to MagickResetIterator() but differs in how MagickAddImage(), MagickReadImage(), and MagickNextImage() behaves afterward.</p>
537 <p>The format of the MagickSetFirstIterator method is:</p>
540 void MagickSetFirstIterator(MagickWand *wand)
543 <p>A description of each parameter follows:</p>
549 <dl class="dl-horizontal">
551 <dd>the magick wand. </dd>
555 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickSetIteratorIndex">MagickSetIteratorIndex</a></h2>
557 <p>MagickSetIteratorIndex() set the iterator to the given position in the image list specified with the index parameter. A zero index will set the first image as current, and so on. Negative indexes can be used to specify an image relative to the end of the images in the wand, with -1 being the last image in the wand.</p>
559 <p>If the index is invalid (range too large for number of images in wand) the function will return MagickFalse, but no 'exception' will be raised, as it is not actually an error. In that case the current image will not change.</p>
561 <p>After using any images added to the wand using MagickAddImage() or MagickReadImage() will be added after the image indexed, regardless of if a zero (first image in list) or negative index (from end) is used.</p>
563 <p>Jumping to index 0 is similar to MagickResetIterator() but differs in how MagickNextImage() behaves afterward.</p>
565 <p>The format of the MagickSetIteratorIndex method is:</p>
568 MagickBooleanType MagickSetIteratorIndex(MagickWand *wand,
572 <p>A description of each parameter follows:</p>
578 <dl class="dl-horizontal">
580 <dd>the magick wand. </dd>
584 <dd>the scene number. </dd>
588 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickSetLastIterator">MagickSetLastIterator</a></h2>
590 <p>MagickSetLastIterator() sets the wand iterator to the last image.</p>
592 <p>The last image is actually the current image, and the next use of MagickPreviousImage() will not change this allowing this function to be used to iterate over the images in the reverse direction. In this sense it is more like MagickResetIterator() than MagickSetFirstIterator().</p>
594 <p>Typically this function is used before MagickAddImage(), MagickReadImage() functions to ensure new images are appended to the very end of wand's image list.</p>
596 <p>The format of the MagickSetLastIterator method is:</p>
599 void MagickSetLastIterator(MagickWand *wand)
602 <p>A description of each parameter follows:</p>
608 <dl class="dl-horizontal">
610 <dd>the magick wand. </dd>
614 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickWandGenesis">MagickWandGenesis</a></h2>
616 <p>MagickWandGenesis() initializes the MagickWand environment.</p>
618 <p>The format of the MagickWandGenesis method is:</p>
621 void MagickWandGenesis(void)
624 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="MagickWandTerminus">MagickWandTerminus</a></h2>
626 <p>MagickWandTerminus() terminates the MagickWand environment.</p>
628 <p>The format of the MaickWandTerminus method is:</p>
631 void MagickWandTerminus(void)
634 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="NewMagickWand">NewMagickWand</a></h2>
636 <p>NewMagickWand() returns a wand required for all other methods in the API. A fatal exception is thrown if there is not enough memory to allocate the wand. Use DestroyMagickWand() to dispose of the wand when it is no longer needed.</p>
638 <p>The format of the NewMagickWand method is:</p>
641 MagickWand *NewMagickWand(void)
644 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="NewMagickWandFromImage">NewMagickWandFromImage</a></h2>
646 <p>NewMagickWandFromImage() returns a wand with an image.</p>
648 <p>The format of the NewMagickWandFromImage method is:</p>
651 MagickWand *NewMagickWandFromImage(const Image *image)
654 <p>A description of each parameter follows:</p>
660 <dl class="dl-horizontal">
666 <h2><a href="../../api/MagickWand/magick-wand_8c.html" id="IsMagickWandInstantiated">IsMagickWandInstantiated</a></h2>
668 <p>IsMagickWandInstantiated() returns MagickTrue if the ImageMagick environment is currently instantiated-- that is, MagickWandGenesis() has been called but MagickWandTerminus() has not.</p>
670 <p>The format of the IsMagickWandInstantiated method is:</p>
673 MagickBooleanType IsMagickWandInstantiated(void)
678 </main><!-- /.container -->
679 <footer class="magick-footer">
680 <p><a href="../www/security-policy.html">Security</a> •
681 <a href="../www/architecture.html">Architecture</a>
683 <a href="magick-wand.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a>
685 <a href="../www/links.html">Related</a> •
686 <a href="../www/sitemap.html">Sitemap</a>
688 <a href="../www/support.html">Donate</a> •
689 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> •
690 <a href="../www/contact.html">Contact Us</a>
692 <small>© 1999-2019 ImageMagick Studio LLC</small></p>
695 <!-- Javascript assets -->
696 <script src="assets/magick.js" crossorigin="anonymous"></script>
697 <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script>
700 <!-- Magick Cache 24th April 2019 13:08 -->