Hallo,
ich würde gerne eine Bild mit dem Modul GD generieren und dass dann ohne zwischen zu speichern direkt ausgeben.
Meine Ansatz:
use GD;
my $bild = new GD::Image(200,25);
my $schwarz = $bild->colorAllocate(0,0,0);
my $weiss = $bild->colorAllocate(255,255,255);
$bild->string(gdLargeFont,0,3,"$par_plaintext",$weiss);
print $bild->png;
print <<show_html;
<html>
<head>
<title>Grafik</title>
</head>
<body>
<h1>Ttest</h1>
<p><img src="$bild->png"></p>
</body>
</html>
show_html
Geht leider nicht, da die Variable: $bild->png anstatt ein Bild den Binärcode ausgibt (kann es leider nicht posten, da das Formular es nicht zulässt).
Wie muss ich das korrekt machen?
Danke.
Nadal
P.S.: Nur das Bild ausgeben ist kein Problem.
Sowas funktioniert also ...
#!/usr/bin/perl -w
use GD;
use strict;
my $bild = new GD::Image(200,25);
my $schwarz = $bild->colorAllocate(0,0,0);
my $weiss = $bild->colorAllocate(255,255,255);
$bild->string(gdLargeFont,0,3,"123213",$weiss);
print "Content-type: image/gif\n\n";
print $bild->gif;