Here is my code. The program crashes at the call of the MagickMergeImageLayers.
Any help ?
Thanks.
Code: Select all
void magickShadow (char * filename)
{
MagickWandGenesis();
MagickWand * pic = NewMagickWand();
MagickReadImage(pic,filename);
PixelWand *blackwand = NewPixelWand();
PixelSetColor(blackwand,"black");
PixelWand *whitewand = NewPixelWand();
PixelSetColor(whitewand,"white");
MagickWand * shadow = CloneMagickWand(pic);
MagickSetImageBackgroundColor(shadow,blackwand);
MagickShadowImage(shadow,90,30,100,100);
MagickAddImage(shadow,pic);
MagickSetImageBackgroundColor(shadow,whitewand);
MagickWand * merge=MagickMergeImageLayers(shadow,MergeLayer); // !!! The program crashes here !!!
MagickWriteImage(merge,filename);
DestroyMagickWand(merge);
DestroyMagickWand(shadow);
DestroyMagickWand(pic);
DestroyPixelWand(blackwand);
DestroyPixelWand(whitewand);
MagickWandTerminus();
}