Menu

#1 imagestring.pl (based on perl/GD)

open
nobody
None
5
2002-09-18
2002-09-18
Anonymous
No

#!/usr/bin/perl -w

# perl/GD based replacment for imagestring.sh
# in use at http://gnudip.dyn.at/

use strict;
use GD;

my $string = $ARGV[0] || '***ERROR***';
my $font = gdGiantFont;

my $im = new GD::Image(130, 30);
my $white = $im->colorAllocate(255, 255, 255);
my $black = $im->colorAllocate(0, 0, 0);
my $red = $im->colorAllocate(255, 0, 0);
my $darkred = $im->colorAllocate(127,0,0);
my $blue = $im->colorAllocate(0,0,255);
my $yellow = $im->colorAllocate(255,255,0);

# $im->transparent($white);
$im->filledRectangle(0,0,129,29,$yellow);
$im->string($font, 20, 8, $string, $darkred);

print "Content-Type: image/png\n\n";
print $im->png;

Discussion


Log in to post a comment.