Ik heb dit scriptje :
<?
header("Content-type: image/png"); // define the usage of a PNG image
$pic = ImageCreate(150, 75); // create an empty 150x75 image
$black = ImageColorAllocate($pic, 0, 0, 0); // defines RGB black
$white = ImageColorAllocate($pic, 255, 255, 255); // defines RGB white
ImageRectangle($pic, 0, 0, 100, 75, $black); // Draw a rectangle in the empty image,
// covering the complete image and fill it with black
ImageTTFText($pic, 32, 0, 10, 50, $white, "/fonts/ln.ttf", "Mitch"); // Write Mitch on it,
// size 32 px, rotation 0, x: 10 y: 50 color: white
ImagePNG($pic); // complete the image
ImageDestroy($pic); // clean up the memory
?>
Zonder de regel ImageTTFText(...) werkt het wel en krijg ik een zwart 150x75 plaatje te zien, maar met die regel erbij zegt php: The image "/....../PIC.php” cannot be displayed, because it contains errors.
Wat is er dan fout? http://sh4d3h.ath.cx/phpinfo.php voor PHPinfo() ... bvd :)
Solved :)
Nieuw probleem:
Pic1.php
<?
header("Content-type: image/png");
// makepic
?>
Pic2.php
<?
header("Content-type: image/png");
// makepic
?>
Index.php
<?
// HTML blabla
<img src="Pic1.php" /><br />
<img src="Pic2.php" /><br />
// HTML blabla
?>

Zoals je misschien al begrepen hebt wordt hier
2 maal een header verzonden en dat wil ie niet doen.
Maar laat ik de 2de bv weg komt er geen plaatje meer :(
Mss iets met ob?

Ook alweer opgelost :)
Mitch helpt zichzelf :p
Jepz :)
Bij het eerste probleem was het de slash naar de dir "/fonts/ln.ttf" moet dus zonder die slash.
En bij het tweede probleem was het een per ongeluk geplaatste spatie voor <?.
Toch een nieuw probleempje:
<select name"imgfont" class="fonts">
<option value="5cent">5 cent</option>
<option value="airone">Airstrip One</option>
<option value="arial">Arial</option>
<option value="comic">Comic Sans MS</option>
<option value="cour">Courier New</option>
<option value="georgia">Georgia</option>
<option value="impact">Impact</option>
<option value="lastninja">Last Ninja</option>
<option value="verdana">Verdana</option>
<option value="xbox">Xbox</option>
</select><br />

Dan geef ik de font in een link mee op deze manier:
<?= $_POST['imgfont']; ?> maar dan geeft hij geen waarde mee ....
Ik kan hem ook niet echo'en bv:
echo "<h1>" . $_POST['imgfont'] . "</h1>";
geeft ook nix...
Alweer glukt :)

Reageren