www.webdeveloper.com
Results 1 to 2 of 2

Thread: adding text to images

  1. #1
    Join Date
    Aug 2006
    Posts
    80

    adding text to images

    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 Code:
    <?php 
    $arr1
    =array('horses.jpg','leop.jpg');
    for(
    $i=0$i<count($arr1); $i++) 
        {
    $image imagecreatefromjpeg($arr1[$i]); 
    $font_size 12
    $color imagecolorallocate($image205,205,255); 
    $black imagecolorallocate($image0,0,0); 
    ImageTTFText ($image$font_size00110$black"../fonts/ARIALBD.TTF","www.abcd.com"); 
    ImageTTFText ($image$font_size0009$color"../fonts/ARIALBD.TTF","www.abcd.com"); 
    header("Content-type: image/jpeg"); 
    imagejpeg($image); 
    imagedestroy($image); 
    }
    ?>
    thanks
    mrjameer

  2. #2
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,739
    You can only one file (of one mime type) for each individual http request. Pages that display text and multiple images are a composite of multiple http requests.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles