![]() |
![]() |
6 Einträge, 1 Seite |
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use strict;
require GD;
require GD::Convert;
import GD::Convert;
my $image_width=69;
my $image_height=32;
my $image_ackground = 'image.jpg';
my $noise_pixels=100;
my $image_background = 'white';
my $std_out_image = 1;
my $font = '/usr/share/syscons/fonts/cp1251-8x14.fnt';
&CreateImage;
exit;
sub CreateImage {
#my $font = GD::Font->load($font) or die(); #Das gibt immer Fehler so wie Out of memory during "large" request for 2147487744 bytes, total sbrk() is 1073152 bytes
my $gd = new GD::Image($image_width,$image_height);
my $black = $gd->colorAllocate(0,0,0);
my $white = $gd->colorAllocate(255,255,255);
my $green = $gd->colorAllocate(0,255,0);
my $blue = $gd->colorAllocate(0,0,255);
my $grey = $gd->colorAllocate(192,192,192);
$gd->fill(1,1,$white);
$gd->rectangle(0,0,$image_width-1,$image_height-1,$black);
#$gd->string($green,gdSmallFont,2,10,"Peachy Keen");
if (defined($std_out_image)) {
#print "Content-type: image/wbmp\n\n";
print "Content-type: image/vnd.wap.wbmp\n\n";
binmode STDOUT;
print $gd->png(); #so geht es super!
#print $gd->wbmp; #so geht aber nicht trotzdem ist in Manpages so ausgezeichnet. http://search.cpan.org/~srezic/GD-Convert-2.12/Convert.pm
} else {
print 'Type is TEXT';
}
return;
}
Usage: GD::Image::wbmp(image, fg) at /usr/local/www/cgi-bin/wapstat/stat.cgi line 41.
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
29
30
31
32
33
34
#!/usr/bin/perl
use strict;
require GD;
my $image_width=69;
my $image_height=32;
my $image_ackground = 'image.jpg';
my $noise_pixels=100;
my $std_out_image = 1;
my $hosts = 'TEXT HERE';
&CreateImage;
exit;
sub CreateImage {
my $gd = new GD::Image($image_width,$image_height);
my $black = $gd->colorAllocate(0,0,0);
my $white = $gd->colorAllocate(255,255,255);
my $green = $gd->colorAllocate(0,255,0);
my $blue = $gd->colorAllocate(0,0,255);
my $grey = $gd->colorAllocate(192,192,192);
$gd->fill(1,1,$white);
$gd->rectangle(0,0,$image_width-1,$image_height-1,$black);
$gd->string(GD::Font->Small,2,10,$hosts, $black);
my $png = $gd->png();
my $wbmpdata = $gd->wbmp($png);
if (defined($std_out_image)) {
print "Content-type: image/vnd.wap.wbmp\n\n";
binmode STDOUT;
print $wbmpdata;
}
return;
}
$gd->fill(1,1,$green);
![]() |
![]() |
6 Einträge, 1 Seite |