Page 1 of 1

Dynamic Image >>> Writing Text on an image...

Posted: Sat May 29, 2004 6:00 pm
by monkeyj
I'm trying to make it whereas I can have an image...
and I can have the LINK to the image be the text written in it...
So far I've got:

Code: Select all

<?php
header("Content-Type: image/PNG");

if (isset($text))&#123;
$blah == $text;
&#125;
else&#123;
$blah == "No text";
&#125; 

$im = ImageCreateFromPNG("bgpic.png"); 
ImageString($im, 2, 90, 19, "$blah", black);
ImagePNG($im);

?>

Posted: Sat May 29, 2004 6:09 pm
by Illusionist

Code: Select all

<?
header("Content-Type: image/PNG");

if (isset($text)){
$blah = $text;    //notice: only one equal sign
}else{
$blah = "No text";   //notice: only one equal sign
}

$im = ImageCreateFromPNG("bgpic.png");
$text_color = imagecolorallocate ($im, 0, 0, 0);
ImageString($im, 2, 90, 19, $blah, $text_color);
ImagePNG($im);

?>
Try that.

Don't think that quite worked

Posted: Sat May 29, 2004 6:30 pm
by monkeyj
I put your code in...
I run it:
http://monkeyblast.com/test1.php?text=BLAHBLADSFLJASDF

but I don't see the text...

Posted: Sat May 29, 2004 7:06 pm
by monkeyj
Nothing Much, i got a working one...
http://monkeyblast.com/test2.php?text=HELLO

Just recentering n stuff now

Posted: Sat May 29, 2004 8:11 pm
by Illusionist
cool, yeah i was going to tell you that you might want to change the coordinates.