View Full Version : images and php
07-21-2007, 11:14 PM
I have an image using the:
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??
07-21-2007, 11:17 PM
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.
// 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
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.