PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
monkeyj
Forum Commoner
Posts: 82 Joined: Mon Dec 15, 2003 4:32 pm
Location: USA
Contact:
Post
by monkeyj » Sat May 29, 2004 6:00 pm
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)){
$blah == $text;
}
else{
$blah == "No text";
}
$im = ImageCreateFromPNG("bgpic.png");
ImageString($im, 2, 90, 19, "$blah", black);
ImagePNG($im);
?>
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Sat May 29, 2004 6:09 pm
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.
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Sat May 29, 2004 8:11 pm
cool, yeah i was going to tell you that you might want to change the coordinates.