in reply to GD::Image-stringTTF() problems....
Update: Aargh you're correct! I actually did test this but as part of a larger script which had already set some colours. I've corrected the above code as marked (thanks!). And for the record this was under NT4. I'll have to try it on a Win9x box sometime.use strict; use warnings; use GD; my $im = new GD::Image(150,60); my $white = $im->colorAllocate(255,255,255); # UPDATE without this th +e background # will be the same as th +e text colour my $blue = $im->colorAllocate(0,0,255); # might as well allocate this + too while I'm at it... my @bounds = $im->stringTTF($blue,'c:/i386/Arial.ttf',22,0,0,36,'123 J +aPh!'); if (!@bounds) {print "TTF error: $@\n";} print join ':', @bounds; open OUT, '>foo.jpg' or die "Couldn't open output: $!"; binmode OUT; print OUT $im->jpeg; close OUT;
--
I'd like to be able to assign to an luser
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Waitasec...
by Anonymous Monk on May 04, 2001 at 01:01 UTC |