[magick-users] Unable to Display Multiple Images[Magick Wand && Magick Core]

quetzlzacatenango at imagemagick.org quetzlzacatenango at imagemagick.org
Sat Sep 16 13:59:06 CDT 2006


> my problem is that I can manipulate the images but can only display 1 at once

Here's a short MagickWand example to display two images simulataneously:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <wand/MagickWand.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
    *one,
    *two;

  pid_t
    pid;

  MagickWandGenesis();
  pid=fork();
  if (pid != 0)
    {
      one=NewMagickWand();  
      status=MagickReadImage(one,"one.gif");
      if (status == MagickFalse)
        ThrowWandException(one);
      MagickDisplayImage(one,":0");
      one=DestroyMagickWand(one);
      return(0);
    }
  two=NewMagickWand();  
  status=MagickReadImage(two,"two.gif");
  if (status == MagickFalse)
    ThrowWandException(two);
  MagickDisplayImage(two,":0");
  two=DestroyMagickWand(two);
  MagickWandTerminus();
  return(0);
}


More information about the Magick-users mailing list