...

View Full Version : adding text to images



mrjameer
03-25-2007, 04:54 PM
hi,


i want to add the text to my images.here is my code but it is adding the text to only first image(horses.jpg) and displaying that image.
this is my code.i want to add www.abc.com on both images.
any of your idea will be appreciated.please find where iam wrong.


<?php
$arr1=array('horses.jpg','leop.jpg');
for($i=0; $i<count($arr1); $i++)
{
$image = imagecreatefromjpeg($arr1[$i]);
$font_size = 12;
$color = imagecolorallocate($image, 205,205,255);
$black = imagecolorallocate($image, 0,0,0);
ImageTTFText ($image, $font_size, 0, 01, 10, $black, "../fonts/ARIALBD.TTF","www.abcd.com");
ImageTTFText ($image, $font_size, 0, 00, 9, $color, "../fonts/ARIALBD.TTF","www.abcd.com");
header("Content-type: image/jpeg");
imagejpeg($image);
imagedestroy($image);
}
?>



thanks
mrjameer

rafiki
03-25-2007, 05:29 PM
you looking for something like this?
http://www.codingforums.com/showthread.php?t=72317

CFMaBiSmAd
03-25-2007, 06:14 PM
His real problem is how to output multiple images.

You cannot output multiple images to a browser unless you place each one in an <img src="ImageURL" alt=""> HTML tag.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum