|
Posted by Martien van Wanrooij on 09/18/05 21:03
Hi all,
Maybe I just didn't enter the right words in google but I am trying to find
out if a image created with the gd library can be sent together to the
client with text based content as one page.
The sample code below shows the image but not the text, probably because of
the header parameters.
<?php
/* this code seems to be compulsory for the image but obviously it also
suppresses all the text I want to send */
header("Content-type: image/png");
$string = $_GET['text'];
$im = imagecreatefrompng("images/button1.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);
/* the text below doesn't appear */
echo "kijken of er ook tekst op kan";
?>
Thanks for any suggestions (which also can be a reference to a webpage that
gives more explanations)
Martien
Navigation:
[Reply to this message]
|