01-05-2008, 10:57 PM
|
#1 (permalink)
|
|
The Visitor
Join Date: Jan 2008
Posts: 3
Thanks: 0
|
Simple GD Code For Text With A Background Image.
I have created a code to make it a background image with text in GD
Hope you enjoy
PHP Code:
<? // CODE CREATED BY ALEX.PRISONER (HTTP://MYWORLDNESS.COM) [ALEX.TUNBRIDGE@HOTMAIL.COM] // header ("Content-type: image/png"); $image = "/* Background image for your text here MUST BE PNG. */"; $im = imagecreatefrompng($image); $font = "arial.ttf"; $text = $_GET['text']; //To add text to this image put yourpage.php?text= Text you want to display here. $white = imagecolorallocate($im, 255, 255, 255); //If you know RBG you can change this but if you don't you might mess with the code :P imagettftext($im, 20, 0, 20, 23, $white, $font, $text); imagepng($im); imagedestroy($im); ?>
|
|
|
|