3. The rotation of the text (0 in (Geocities web hosting)

3. The rotation of the text (0 in this example) 4. The x coordinate for the starting position of the text, with 0 being the leftmost boundary of the image (20 in this example) 5. The y coordinate for the starting position of the text, with 0 being the upper boundary of the image (20 in this example) 6. The color of the text using the color index (0, or black, in this example) 7. The name of the font file you want to reference, to be located automatically in the default font directory (arial.ttf in this example) 8. The string of text to be shown (contents of the $image_caption variable in this example) Again, feel free to experiment with different fonts, colors, and locations for your text this is only one small example. In the course of your experimentation, be sure you fill in values for each one of the eight parameters, or you will get an error message. Adding Watermarks and Merging Images Because you are showing these images on the Movie Review Site, make your logo show up lightly behind each image that is hosted by you, as a sort of watermark. You can do this with your own logo to protect any copyrighted images, as we did easily enough with the text. In this section, you will actually be merging two images (your source image and your logo image) to create the desired effect. Let s make the changes. Try it Out Merging Two Images To merge the two images, you will again need to change your showimage.php file and your modify image.php file. 1. Add the following line to your showimage.php file, in the same section as before: include Movie Review Site watermark
2. Add the following line to your modifyimage.php file, as before: //**INSERT NEAR THE TOP OF THE FILE if (isset($_POST[ watermark ])) { $watermark = $_POST[ watermark ]; } else { $watermark = ; } Then add the following lines later on in the script: if ($watermark == on ) { $image2 = imagecreatefromgif( images/logo.gif ); imagecopymerge($image, $image2, 0,0,0, 0, $width, $height, 15); } 218 Chapter 7
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Leave a Reply