Page 563 - Beginning PHP 5.3
P. 563

Chapter 17:  Generating Images with PHP


                           In this case you want the entire image to be copied across, so you use  0,0  as the top - left position of
                         the block to copy, and the entire width and height of your copyright image as the width and height
                         of the block.
                           After the data is copied across, you output the image as usual. Remember to clean up the memory that
                         both images have used:

                             header( “Content-type: image/jpeg” );
                             imagejpeg( $myImage );
                             imagedestroy( $myImage );
                             imagedestroy( $myCopyright );
                             ? >


































                                 Figure 17-18


                           There ’ s a slight problem here. As you can clearly see in the figure, a large portion of the image is now
                          obscured. In the next section you refine the script so that you can see more of the image.

                           Working with Transparency
                           Rather than copy the entire copyright image as - is, you can copy just the black text across. To do this, you
                         need to make the white area of the copyright image transparent.







                                                                                                         525





                                                                                                      9/21/09   2:48:44 PM
          c17.indd   525
          c17.indd   525                                                                              9/21/09   2:48:44 PM
   558   559   560   561   562   563   564   565   566   567   568