Problem with ArcDistortion

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
javiersm

Problem with ArcDistortion

Post by javiersm »

Good Morning,

I'm trying to bend a text string with ArcDistortion, but I have a problem. My code is :

Code: Select all

main()
{
        MagickWandGenesis();

        MagickWand* wand = NewMagickWand();
        DrawingWand* dwand = NewDrawingWand();
        PixelWand* pwand = NewPixelWand();
        PixelSetColor(pwand,"red");
        DrawSetGravity(dwand,CenterGravity);
        DrawSetFontSize(dwand,25);
        DrawSetFont(dwand,"Utopia-Regular");
        DrawSetFillColor(dwand,pwand);
        DrawAnnotation(dwand,0,0,"hello!");
        PixelSetColor(pwand,"none");
        MagickNewImage(wand,200,200,pwand);
        MagickDrawImage(wand,dwand);
        MagickTrimImage(wand,0);
        double dargs[1] ;
        dargs[0] = 90;
        MagickDistortImage(wand, ArcDistortion, 1, dargs, MagickTrue );
        
        //Clean Up
}
The problem is that, getting trim the wand before, when I use ArcDistortion this wand becomes to four red pixels instead the word "hello!" bended and trimed. Note that I use MagickTrue in the parameter "Best-fit", is something wrong in my code to achieve this result? Thanks a lot! Best regards.
javiersm

Re: Problem with ArcDistortion

Post by javiersm »

Another thing, if I trim the string after bending it, the angle is not real, I suppose that this is because the string is not trimed and the text is in the center position and the string describes the top of the parabola that may describe the word, how can I make the word describes exactly the angle that I pass into the argument of ArcDistortion, thanks a lot again! Best regards.
Post Reply