# ImageMagick: MagickWand, C API for ImageMagick: Magick Wand Methods
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 [cut: 1167 characters, first 599 kept]
Author: ImageMagick Studio LLC
Keywords: magickwc, api, for, imagemagick:, magick, wmethods, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand

## ClearMagickWand

ClearMagickWand() clears resources associated with the wand.

The format of the ClearMagickWand method is:

      void ClearMagickWand(MagickWand *wand)

A description of each parameter follows:

##### wand

The magick wand.

## CloneMagickWand

CloneMagickWand() makes an exact copy of the specified wand.

The format of the CloneMagickWand method is:

      MagickWand *CloneMagickWand(const MagickWand *wand)

A description of each parameter follows:

##### wand

The magick wand.

## DestroyMagickWand

DestroyMagickWand() deallocates memory associated with an MagickWand.

The format of the DestroyMagickWand method is:

      MagickWand *DestroyMagickWand(MagickWand *wand)

A description of each parameter follows:

##### wand

The magick wand.

## IsMagickWand

IsMagickWand() returns MagickTrue if the wand is verified as a magick wand.

The format of the IsMagickWand method is:

      MagickBooleanType IsMagickWand(const MagickWand *wand)

A description of each parameter follows:

##### wand

The magick wand.

## MagickClearException

MagickClearException() clear any exceptions associated with the wand.

The format of the MagickClearException method is:

      MagickBooleanType MagickClearException(MagickWand *wand)

A description of each parameter follows:

##### wand

The magick wand.

## MagickGetIteratorIndex

MagickGetIteratorIndex() returns the position of the iterator in the image list.

The format of the MagickGetIteratorIndex method is:

      MagickBooleanType MagickGetIteratorIndex(MagickWand *wand)

A description of each parameter follows:

##### wand

The magick wand.

## MagickQueryConfigureOption

MagickQueryConfigureOption() returns the value associated with the specified configure option.

The format of the MagickQueryConfigureOption function is:

      char *MagickQueryConfigureOption(const char *option)

A description of each parameter follows:

##### option

The option name.

## MagickQueryConfigureOptions

MagickQueryConfigureOptions() returns any configure options that match the specified pattern (e.g. "*" for all). Options include NAME, VERSION, LIB_VERSION, etc.

The format of the MagickQueryConfigureOptions function is:

      char **MagickQueryConfigureOptions(const char *pattern,
        unsigned long *number_options)

A description of each parameter follows:

##### pattern

Specifies a pointer to a text string containing a pattern.

##### number_options

Returns the number of configure options in the list.

## MagickQueryFontMetrics

MagickQueryFontMetrics() returns a 13 element array representing the following font metrics:

          Element Description
          -------------------------------------------------
          0 character width
          1 character height
          2 ascender
          3 descender
          4 text width
          5 text height
          6 maximum horizontal advance
          7 bounding box: x1
          8 bounding box: y1
          9 bounding box: x2
         10 bounding box: y2
         11 origin: x
         12 origin: y

The format of the MagickQueryFontMetrics method is:

      double *MagickQueryFontMetrics(MagickWand *wand,
        const DrawingWand *drawing_wand,const char *text)

A description of each parameter follows:

##### wand

The Magick wand.

##### drawing_wand

The drawing wand.

##### text

The text.

## MagickQueryMultilineFontMetrics

MagickQueryMultilineFontMetrics() returns a 13 element array representing the following font metrics:

          Element Description
          -------------------------------------------------
          0 character width
          1 character height
          2 ascender
          3 descender
          4 text width
          5 text height
          6 maximum horizontal advance
          7 bounding box: x1
          8 bounding box: y1
          9 bounding box: x2
         10 bounding box: y2
         11 origin: x
         12 origin: y

This method is like MagickQueryFontMetrics() but it returns the maximum text width and height for multiple lines of text.

The format of the MagickQueryFontMetrics method is:

      double *MagickQueryMultilineFontMetrics(MagickWand *wand,
        const DrawingWand *drawing_wand,const char *text)

A description of each parameter follows:

##### wand

The Magick wand.

##### drawing_wand

The drawing wand.

##### text

The text.

## MagickQueryFonts

MagickQueryFonts() returns any font that match the specified pattern (e.g. "*" for all).

The format of the MagickQueryFonts function is:

      char **MagickQueryFonts(const char *pattern,unsigned long *number_fonts)

A description of each parameter follows:

##### pattern

Specifies a pointer to a text string containing a pattern.

##### number_fonts

Returns the number of fonts in the list.

## MagickQueryFonts

MagickQueryFonts() returns any image formats that match the specified pattern (e.g. "*" for all).

The format of the MagickQueryFonts function is:

      char **MagickQueryFonts(const char *pattern,
        unsigned long *number_formats)

A description of each parameter follows:

##### pattern

Specifies a pointer to a text string containing a pattern.

##### number_formats

This integer returns the number of image formats in the list.

## MagickRelinquishMemory

MagickRelinquishMemory() relinquishes memory resources returned by such methods as MagickIdentifyImage(), MagickGetException(), etc.

The format of the MagickRelinquishMemory method is:

      void *MagickRelinquishMemory(void *resource)

A description of each parameter follows:

##### resource

Relinquish the memory associated with this resource.

## MagickResetIterator

MagickResetIterator() resets the wand iterator. Use it in conjunction with MagickNextImage() to iterate over all the images in a wand container.

The format of the MagickResetIterator method is:

      void MagickResetIterator(MagickWand *wand)

A description of each parameter follows:

##### wand

The magick wand.

## MagickSetFirstIterator

MagickSetFirstIterator() sets the wand iterator to the first image.

The format of the MagickSetFirstIterator method is:

      void MagickSetFirstIterator(MagickWand *wand)

A description of each parameter follows:

##### wand

The magick wand.

## MagickSetIteratorIndex

MagickSetIteratorIndex() set the iterator to the position in the image list specified with the index parameter.

The format of the MagickSetIteratorIndex method is:

      MagickBooleanType MagickSetIteratorIndex(MagickWand *wand,
        const long index)

A description of each parameter follows:

##### wand

The magick wand.

##### index

The scene number.

## MagickSetLastIterator

MagickSetLastIterator() sets the wand iterator to the last image.

The format of the MagickSetLastIterator method is:

      void MagickSetLastIterator(MagickWand *wand)

A description of each parameter follows:

##### wand

The magick wand.

## MagickWandGenesis

MagickWandGenesis() initializes the MagickWand environment.

The format of the MaickWandGenesis method is:

      void MaickWandGenesis(void)

## MagickWandTerminus

MagickWandTerminus() initializes the MagickWand environment.

The format of the MaickWandTerminus method is:

      void MaickWandTerminus(void)

## NewMagickWand

NewMagickWand() returns a wand required for all other methods in the API.

The format of the NewMagickWand method is:

      MagickWand *NewMagickWand(void)

## NewMagickWandWithImage

NewMagickWandWithImage() returns a wand with an image.

The format of the NewMagickWandWithImage method is:

      MagickWand NewMagickWandWithImage(const Image *image)

A description of each parameter follows:

##### image

The image.

Discourse Server • Mailing Lists • ImageMagick Studio