Leser: 1
|< 1 2 3 >| | 26 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl &n
bsp;
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
eval "use GD";
if(!$@){
&start;
}
else{
die "Modul nicht installiert!";
}
sub start{
print "Content-type: image/png\n\n";
$image = new GD::Image(100,20);
$rot = $image->colorAllocate(255,0,0);
$weiss = $image->colorAllocate(255,255,255);
$image->string(gdMediumBoldFont,3,5,"Test",$weiss);
binmode STDOUT;
print $image->jpeg;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl &n
bsp;
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
use GD;
&start;
sub start{
print "Content-type: image/png\n\n";
$image = new GD::Image(100,20);
$rot = $image->colorAllocate(255,0,0);
$weiss = $image->colorAllocate(255,255,255);
$image->string(gdMediumBoldFont,3,5,"Test",$weiss);
binmode STDOUT;
print $image->jpeg;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
use strict;
use warnings 'all';
eval { require GD };
unless ($@)
{
import GD;
# start
}
else
{
die "module 'GD' not installed";
exit(1);
}
exit(0);
__END__
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
#!/usr/bin/perl
use strict;
use warnings 'all';
# we need GD
eval { require GD };
unless ($@)
{
# if GD is installed, call GD::import
import GD;
# and start
start();
}
else
{
# exit with errorlevel > 0
exit(1);
}
# all was right, so exit with errorlevel == 0
exit(0);
# start here(GD is installed)
sub start
{
print "Content-type: image/png\n\n";
my $image = new GD::Image(100,20);
my $rot = $image->colorAllocate(255,0,0);
my $weiss = $image->colorAllocate(255,255,255);
$image->string(GD::gdMediumBoldFont(),3,5,"Test",$weiss);
binmode STDOUT;
print $image->jpeg;
} # start
__END__
use GD;
Can't locate GD.pm in @INC...
eval "use GD;";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
use strict;
use warnings 'all';
eval { require GD };
unless ($@)
{
import GD;
# start
}
else
{
die "module 'GD' not installed";
exit(1);
}
exit(0);
__END__
|< 1 2 3 >| | 26 Einträge, 3 Seiten |