tailieunhanh - Beginning PHP6, Apache, MySQL Web Development- P9

Beginning PHP6, Apache, MySQL Web Development- P9:Welcome to Beginning PHP6, Apache, MySQL Web Development , your new trusty resource for assistance in creating your own dynamic web sites. There are a lot of technologies available that can be used to deliver great web sites, and we ’ re glad you chose the Apache/MySQL/PHP (sometimes referred to simply as AMP) approach. You may or may not have had a taste of these three components in the past, but either way we ’ re confident that you will be impressed with the power that lies within them | Chapter 7 Manipulating and Creating Images with PHP 2. Add the following line to your file as before add the caption if requested if isset _GET capt imagettftext image 12 0 20 20 0 font _GET capt add the logo watermark if requested if isset _GET logo determine x and y position to center watermark list width height getimagesize dir . . _GET id . .jpg list wmk_width wmk_height getimagesize images x width - wmk_width 2 y height - wmk_height 2 wmk imagecreatefrompng images imagecopymerge image wmk x y 0 0 wmk_width wmk_height 20 imagedestroy wmk show the image header Content-Type image jpeg imagejpeg image 100 3. Go ahead and try it out Your screen should resemble that in Figure 7-9. Figure 7-9 211 Part I Movie Review Web Site How It Works You have simply added another option for your users and you did it using the imagecopymerge function. Note that before you could merge the two images you had to make the second image GD friendly by creating a duplicate copy. Because your image was a PNG image you used the imagecreatefrompng function. The nine arguments for the imagecopymerge function are as follows in this order 1. The resource of the destination image image in this example since the image file is the one you are making all the changes to and the one that will be shown at the end of your script . 2. The resource of the second image or source image wmk in this example . 3. The x-coordinate on the destination image 0 represents the leftmost boundary . 4. The y-coordinate on the destination image 0 represents the uppermost boundary . 5. The x-coordinate on the second image to start copying from 0 in this example because you want the whole image . 6. The y-coordinate on the second image to start copying from 0 in this example because you want the whole image . 7. The width of the portion of the second image to be merged wmk_width in this example representing as much of the second image as will fit on the destination image . 8. The .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.