PerlMagick: Annotate doesn't translate
Posted: 2008-05-27T21:30:19-07:00
When I use the Annotate method in an image, the translate parameter doesn't do anything.
The following code doesn't crash or give any warnings, but the red text should be translated 10px down and to the right of the black text, and it isn't:
The same behavior happens (or rather, fails to happen) with ImageMagick 6.4.1 04/29/08 Q16 on Windows XP SP3, and with ImageMagick 6.4.1 04/30/08 Q16 on Linux 2.6.9-55.0.2.ELsmp.
The following code doesn't crash or give any warnings, but the red text should be translated 10px down and to the right of the black text, and it isn't:
Code: Select all
#!/usr/bin/perl
use strict;
use Image::Magick;
my $img = Image::Magick->new;
$img->Set(size=>"200x100");
$img->Read("xc:white");
$img->Annotate(
text=>"testing 1 2 3",
pointsize=>24,
fill=>"black",
antialias=>"true",
x=>100,
y=>50,
align=>"Center"
);
$img->Annotate(
text=>"testing 1 2 3",
pointsize=>24,
fill=>"red",
antialias=>"true",
x=>100,
y=>50,
translate=>"10,10",
align=>"Center"
);
binmode STDOUT;
$img->Write("PNG24:foo.png");