Can you imagecreatefrompng() & imagecopymerge() in one go?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kip1790
    New Member
    • Jun 2009
    • 13

    Can you imagecreatefrompng() & imagecopymerge() in one go?

    Is it possible to write text to an image using imagecreatefrom png() like here and merge the image produced with icon.png for example, in one go?

    The output of this PHP produced the image in the link above, I'm looking to merge this output with $icon below:
    Code:
    <?php
    $bg = $_REQUEST['bg'] ;
    $my_img = imagecreatefromjpeg( $bg);
    $text_colour = imagecolorallocate( $my_img, 255, 255, 255 );
    $input_text = $_REQUEST['name'] ;
    [B]$icon = imagecreatefrompng('sun.png');[/B]
    
    imagestring( $my_img, 10, 30, 32, $input_text, $text_colour );
    imagesetthickness ( $my_img, 5 );
    
    
    header( "Content-type: image/png" );
    imagepng( $my_img );
    
    imagecolordeallocate( $text_color );
    
    imagedestroy( $my_img );
    ?>
    Any suggestions, what code would I need to imagecopymerge with $icon?
Working...