Page 1 of 1

Problem with ArcDistortion

Posted: 2009-03-24T04:13:30-07:00
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.

Re: Problem with ArcDistortion

Posted: 2009-03-24T04:41:18-07:00
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.