in reply to How to use Imager for text
#!/usr/bin/perl use warnings; use strict; use Imager; my $img = Imager->new(xsize=>400,ysize=>50,channels=>4); my $blue = Imager::Color->new("#0000FF"); my $font = Imager::Font->new( file => 'Generic.ttf', color => $blue, size => 30); $img->string(font => $font, text => "Model-XYZ", x => 15, y => 40, size => 40, color => $blue, aa => 1); $img->write(file=>$0.'.png', type=>'png') or die "Cannot write: ",$img->errstr; my $img_mirror = $img->copy(); $img_mirror->flip( dir => "h" ); $img_mirror->write(file=>$0.'-mirror.png', type=>'png') or die "Cannot write: ",$img_mirror->errstr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to use Imager for text
by bradcathey (Prior) on Oct 28, 2005 at 22:03 UTC | |
by zentara (Cardinal) on Oct 29, 2005 at 11:14 UTC | |
by bradcathey (Prior) on Oct 29, 2005 at 13:58 UTC | |
by tonyc (Hermit) on Oct 30, 2005 at 23:44 UTC |