../index.html
[ImageMagick]
http://www.imagemagick.org/
[sponsor]
../index.html
../index.html
#main
Skip to page contents
[
../index.html
About ImageMagick
../www/command-line-tools.html
Command-line Tools
../www/api.html
Program Interfaces
]
[
../www/install-source.html
Install from Source
../www/binary-releases.html
Binary Releases
../www/resources.html
Resources
]
[
../www/download.html
Downloads
]
[
../www/links.html
Links
]
[
../www/sponsors.html
Sponsors
http://www.devlib.org
IT and Programming
Resources
]
The MagickWand API is the recommended interface between the C programming language and the ImageMagick image processing libraries.  Unlike the
../www/magick-core.html
MagickCore
C API, MagickWand uses only a few opaque types.  Accessors are available to set or get important wand attributes.  A description of the MagickWand public methods are found here:
../www/api/magick-wand.html
Magick Wand Methods
../www/api/magick-attribute.html
Set or Get Magick Wand Attributes
../www/api/magick-image.html
Magick Wand Image Methods
../www/api/pixel-iterator.html
Pixel Iterator Methods
../www/api/pixel-wand.html
Pixel Wand Methods
../www/api/drawing-wand.html
Image Vector Drawing
After you write your MagickWand program, compile it like this:
cc `Wand-config --cflags --cppflags` wand.c `Wand-config --ldflags --libs`
Here is a example program that utilizes the MagickWand API to get you started,
../www/source/wand.c
wand.c
. It reads a GIF image, creates a thumbnail, and writes it to disk in the PNG image format.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wand/magick-wand.h>
int main(int argc,char **argv)
{
#define ThrowWandException(wand) \
{ \
char \
*description; \
\
ExceptionType \
severity; \
\
description=MagickGetException(wand,&severity); \
(void) fprintf(stderr,"%s %s %ld %s\n",GetMagickModule(),description); \
description=(char *) MagickRelinquishMemory(description); \
exit(-1); \
}
MagickBooleanType
status;
MagickWand
*magick_wand;
/*
Read an image.
*/
magick_wand=NewMagickWand();
status=MagickReadImage(magick_wand,"image.gif");
if (status == MagickFalse)
ThrowWandException(magick_wand);
/*
Turn the images into a thumbnail sequence.
*/
MagickResetIterator(magick_wand);
while (MagickNextImage(magick_wand) != MagickFalse)
MagickResizeImage(magick_wand,106,80,LanczosFilter,1.0);
/*
Write the image as MIFF and destroy it.
*/
status=MagickWriteImages(magick_wand,"image.png",MagickTrue);
if (status == MagickFalse)
ThrowWandException(magick_wand);
magick_wand=DestroyMagickWand(magick_wand);
return(0);
}
http://redux.imagemagick.org/discussion-server
Discourse Server
|
../www/mailing-list.html
Mailing Lists
|
http://redux.imagemagick.org/gallery
Image Gallery
|
http://studio.webbyland.com/MagickStudio/scripts/MagickStudio.cgi
ImageMagick Studio
© 1999-2005 ImageMagick Studio LLC
