PerlMagick Annotate Rotate text

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
myicq
Posts: 29
Joined: 2012-04-11T04:23:21-07:00
Authentication code: 8675308

PerlMagick Annotate Rotate text

Post by myicq » 2015-06-16T02:56:30-07:00

I have (FINALLY) found out how to rotate text in PerlMagick.

But the logic does not match what I expected.

First : version = ImageMagick 6.9.1-2 Q16 x86 2015-04-14 http://www.imagemagick.org

My goal is to write text vertically rotated 90 degrees clockwise.

I kind of expected the syntax to be this:

Code: Select all

$r = $image->Annotate(
            text=>'MyText',
            geometry=>90x90+0+200,
            font=>'arial.ttf',
            fill=>'black',
            gravity=>'northwest',
            pointsize=>20
            );
But that did not rotate text !! No matter what value of 90x90 or 45x45, as per examples in documents.

It was not until I tried rotate parameter.

Code: Select all

$r = $image->Annotate(
            text=>'MyText',
            geometry=>90x90+0+200,
            font=>'arial.ttf',
            fill=>'black',
            gravity=>'northwest',
            rotate=>90,         # <<<<<<< NOTICE THIS <<<<<<<<
            pointsize=>20
            );
Is this explained ANYWHERE ? All documentation / examples show I have to use geometry. No mention of rotate.

It works for me now, but really could use some documentation links here with examples.

snibgo
Posts: 12400
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PerlMagick Annotate Rotate text

Post by snibgo » 2015-06-16T03:21:02-07:00

On http://www.imagemagick.org/script/perl-magick.php , under "Annotate", one of the listed parameters is "rotate".
snibgo's IM pages: im.snibgo.com

Post Reply