alex57
07-21-2007, 11:14 PM
Hello,
I have an image using the:
<img src="">
standard image html notation. How would I create an image that displayed text echoed using php. For example I would like the result of:
echo "hello world"
to be displayed on my image??
thanks
_Aerospace_Eng_
07-21-2007, 11:17 PM
http://www.phpbuilder.com/columns/rasmus19990124.php3
alex57
07-21-2007, 11:32 PM
I found this code on a website to write a string on an image. Is there a PHP function which accepts parameters such as picture.jpg instead of values as with "imagecreate(100, 30)" or another way to use an image i have created in photoshop. The way you suggested i didnt think gave much control over the look of the button for a novice.
<?php
// create a 100*30 image
$im = imagecreate(100, 30);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// write the string at the top left
imagestring($im, 5, 0, 0, "Hello world!", $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>