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]);
....
....
....
------------ 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]);
....
....
....