1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use warnings; use strict; use GD; my $x = 36; my $y = 21; my @arr=("2","3","4","5","6","7","8","9"); for(my $i = 0; $i <= $#arr; $i++) { my $image = new GD::Image($x,$y); my $white = $image->colorAllocate(255,255,255); my $red = $image->colorAllocate(255,0,0); my $black = $image->colorAllocate(0,0,0); $image->filledRectangle(0,0,35,20,$white); $image->string(gdGiantFont,2,1,$arr[$i],$red); $image->string(gdGiantFont,17,1,$arr[$i],$black); my $outimage = $image->gif(); open FILE,"> $arr[$i]h.gif"; print FILE $outimage; close FILE; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/usr/bin/perl use warnings; use strict; use GD; my $width = 36; my $height = 21; my $file='images/%uh.gif'; for my $i (2..9) { my $image = GD::Image->new($width,$height); my $white = $image->colorAllocate(255,255,255); my $red = $image->colorAllocate(255,0,0); my $black = $image->colorAllocate(0,0,0); $image->filledRectangle(0,0,35,20,$white); $image->string(gdGiantFont,2,1,$i,$red); $image->string(gdGiantFont,17,1,$i,$black); my $f=sprintf($file,$i); print "WRITE: $f\n"; open(my $fh, '>:raw', $f) or die("ERROR open $f ($!)\n"); print $fh $image->gif(); close($fh); }
2011-05-11T23:37:21 KKOStrawberry auf WinXP, GD Vers. 2.46
2011-05-11T21:37:55 topegbei mir funktioniert es:
binmode FILE;
2011-05-12T13:03:55 KKODANKE an Alle!!