Annotate after Crop - unexpected x,y position
Posted: 2008-04-12T07:45:26-07:00
This is supposed to put text on the picture, in the center just above the bottom of the image:
so I do:
>...
>MagickAnnotateImage(magick_wand_copy,drawing_wand, (iw/2)+3,(ih-FontSize/2)+3,0,txt);
and it works.
but - when I do:
>MagickCropImage(magick_wand_copy, MagickGetImageWidth(magick_wand_copy), 700, 0, 130);
>...
>MagickAnnotateImage(magick_wand_copy,drawing_wand, (iw/2)+3,(ih-FontSize/2)+3,0,txt);
the text is to high.
Right now I am fixing it by inserting the following lines between Crop and Annodate:
>status=MagickSetImageFormat(magick_wand_copy,"bmp");
>m = MagickGetImageBlob(magick_wand_copy, &l);
>DestroyMagickWand(magick_wand_copy);
>magick_wand_copy = NewMagickWand();
>MagickSetImageFormat(magick_wand_copy,"bmp");
>MagickReadImageBlob(magick_wand_copy,m,l);
And - it works!
How can I avopid putting that extra code in ?
thanks
Roland
so I do:
>...
>MagickAnnotateImage(magick_wand_copy,drawing_wand, (iw/2)+3,(ih-FontSize/2)+3,0,txt);
and it works.
but - when I do:
>MagickCropImage(magick_wand_copy, MagickGetImageWidth(magick_wand_copy), 700, 0, 130);
>...
>MagickAnnotateImage(magick_wand_copy,drawing_wand, (iw/2)+3,(ih-FontSize/2)+3,0,txt);
the text is to high.
Right now I am fixing it by inserting the following lines between Crop and Annodate:
>status=MagickSetImageFormat(magick_wand_copy,"bmp");
>m = MagickGetImageBlob(magick_wand_copy, &l);
>DestroyMagickWand(magick_wand_copy);
>magick_wand_copy = NewMagickWand();
>MagickSetImageFormat(magick_wand_copy,"bmp");
>MagickReadImageBlob(magick_wand_copy,m,l);
And - it works!
How can I avopid putting that extra code in ?
thanks
Roland