Hier mal die alte Version meiner draw as image funktionalität meines goto scriptes:
Code
$font = 2;
$datei = file($string);
$datei[] = " ";
$datei[] = "===== DATEIENDE ======================= ". date("d") .". ". date("m") .". ". date("Y") ." =";
$datei[] = "Text in Bild umwandlung by: Modula <modula@daoc-ds.de>";
$datei[] = "http://tests.daoc-ds.de/goto";
$datei[] = "======================================= (c) 2005 =====";
foreach($datei AS $zeile) {
$maxlen = (strlen($zeile) > $maxlen) ? strlen($zeile) : $maxlen;
$height+= imagefontheight($font) + 2;
}
$width = imagefontwidth($font) * $maxlen;
$image = imagecreate($width+2, $height+4);
$black = imagecolorallocate($image, 0, 0, 0); //background
$white = imagecolorallocate($image, 255, 255, 255);
$y_pos = 1;
foreach($datei AS $zeile) {
$zeile = str_replace("\n", "", $zeile);
$zeile = str_replace("\r", "", $zeile);
$zeile = str_replace("\t", " ", $zeile);
imagestring($image, $font, 1, $y_pos, $zeile, $white);
$y_pos+= imagefontheight($font) + 2;
}
header ("Content-type: image/png");
imagepng($image);
imagedestroy($image);
exit;
Alles anzeigen
die Funktionen die du brauchst wären: Image, imagestring, imagecolorallocate, imagefontwidth, imagefontheight, imagepng, imagedestroy und header
Bei Fragen, stellen!