11-30-2011, 08:41 AM
|
#18 (permalink)
|
|
The Visitor
Join Date: Nov 2011
Posts: 3
Thanks: 0
|
Hi, I found this but when I test it I see only a black image?
<?php
// show the correct header for the image type
header("Content-type: image/jpg");
// an email address in a string
$string = "email@example.com";
// some variables to set
$font = 4;
$width = ImageFontWidth($font) * strlen($string);
$height = ImageFontHeight($font);
// lets begin by creating an image
$im = @imagecreatetruecolor ($width,$height);
//white background
$background_color = imagecolorallocate ($im, 255, 255, 255);
//black text
$text_color = imagecolorallocate ($im, 0, 0, 0);
// put it all together
imagestring ($im, $font, 0, 0, $string, $text_color);
// and display
imagejpeg ($im);
?>
Last edited by Francis : 12-01-2011 at 08:50 AM.
|
|
|
|