in reply to Re^2: How to use Imager for text
in thread How to use Imager for text
#!/usr/bin/perl use warnings; use strict; use CGI::Carp qw(fatalsToBrowser); use Imager; my $img = Imager->new(xsize=>400,ysize=>300); $img->box(filled=>1, color=>"ffffff"); #fill the background color my $blue = Imager::Color->new("#0000FF"); my $font = Imager::Font->new( file => 'Generic.ttf', index => 0, color => $blue, size => 30, aa => 1); $img->string( font=>$font, text=>'This is a test string', x=>20, y=>70); $img->write(file=>"$0.jpg", type=>"jpeg") or die "Cannot write file: +", Imager->errstr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to use Imager for text
by bradcathey (Prior) on Oct 29, 2005 at 13:58 UTC | |
by tonyc (Hermit) on Oct 30, 2005 at 23:44 UTC |