> Forums > PHP

D

Dynamisches Bild mit Text aus einer *.txt-Datei

phpinfo Mi., 18. Oktober, 2006 um 23:46 #1

Dieser Code erzeigt ein Dynamisches Bild mit einem Text aus einer Textdatei ...

[php:1]<?php
$text_datei = "text.txt"; //Namen der Textdatei

$fp = fopen("$text_datei", "r");
while($text=fgets($fp,45))
$text2 = $text;

header ("Content-type: image/PNG");
$mein_bild = ImageCreate (400, 20);
$weiss = ImageColorAllocate ($mein_bild,255,255,255);
$blau = ImageColorAllocate ($mein_bild, 21, 0, 177);
$gruen = ImageColorAllocate ($mein_bild, 50,148,0);
$rot = ImageColorAllocate ($mein_bild, 255,0,25);
$hellblau = ImageColorAllocate ($mein_bild,0,255,242);
$schwarz = ImageColorAllocate ($mein_bild,0,0,0);

ImageString ($mein_bild, 3, 2, 1, "$text", $schwarz);
ImagePNG ($mein_bild);

fclose($fp);

?>[/php:1]



C&M distanziert sich konkret und ausdrücklich vom Inhalt dieses Postings.
Der Ersteller des Postings haftet für seine Äußerungen.
Inhalte, die nicht den Forumsregeln entsprechen sind bitte vom Leser zu melden ...

> Forums > PHP

Du hast bereits für diesen Post angestimmt...

;-)



Logo https://t.ress.at/4ceK9/


Ähnliche Themen:











Top