Click to See Complete Forum and Search --> : Text on image! need help!!


persa
03-16-2004, 01:05 PM
why doesnt it written a text inside a box on the resized image?

------------ CODE -------------

$image_data = getimagesize($pfile);
$pic_width = $image_data[0];
$pic_height = $image_data[1];
.....
..........
.......
$number = $max_width/$pic_width;
$pic_height = $pic_height * $number;
$pic_width = $max_width;
//lage bilde
$src = ImageCreateFromJpeg($pfile);

$dst = imagecreatetruecolor($pic_width,$pic_height);
// RESIZE BILDE
$bgc = imagecolorallocate ($dst, 204, 204, 204);
$tc = imagecolorallocate ($dst, 0, 0, 0);

$red = imagecolorallocate($dst, 255, 0, 0);
$font_file = "/hsphere/local/home/hamarlif/hamarliftutleie.no/temp/design/fonts/verdana.ttf";
imagefilledrectangle ($dst, 0, 0, 100, 22, $bgc);
imagettftext ($dst, 10, 0, 5, 16, $tc, $font_file ,"© hamarliftutleie.no");

imagecopyresampled($dst, $src, 0, 0, 0, 0, $pic_width,$pic_height,$image_data[0],$image_data[1]);
....
....
....

persa
03-16-2004, 01:55 PM
And I doesn't get any errors either.. it just don't write any text on the picture.

The Cheat
03-16-2004, 02:39 PM
hey, i dont have time to look at your script right now, as i got to get working on my homework. However, here is a script i wrote that makes a random image, i hope this will help you.

-tc