Thread GD - Fehler in erzeugten Gif-Files (12 answers)
Opened by KKO at 2011-05-11 23:01

topeg
 2011-05-11 23:37
#148483 #148483
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
bei mir funktioniert es:
Code (perl): (dl )
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);
}

Sofern du die Zahlen 2 bin 9 einmal in rot und einmal in schwarz auf weißen Grund haben willst.

View full thread GD - Fehler in erzeugten Gif-Files