Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2011
    Location
    New Zealand
    Posts
    34
    Thanks
    11
    Thanked 2 Times in 2 Posts

    Overlap another image on-top of a PHP generated image.

    Hi all, I'm trying to overlap 1 image ontop of another php generated image. The following is my code.

    PHP Code:
    $my_img imagecreatefrompng "sig1.png" );
    while(
    $info $user->fetch(PDO::FETCH_ASSOC))
    {
        
    $text_colour imagecolorallocate$my_img255255255 ); $name_colour imagecolorallocate$my_img238238238 ); 
        
    $KDRatio $info['Kills'] / ($info['Deaths'] ?: 1); $KDRatio sprintf('%0.2f'$KDRatio); $OnlineTime secondsToTime($info['OnlineTime']);
        
    imagettftext($my_img32030028$name_colour'fonts/pricedown.ttf',"$info[User]");
        
    //Coloum 1
        
    imagettftext($my_img13030060$text_colour'fonts/tahoma-bold.ttf',"0 Arrests");
        
    imagettftext($my_img13030079$text_colour'fonts/tahoma-bold.ttf',"0 Tickets");
        
    imagettftext($my_img13030097$text_colour'fonts/tahoma-bold.ttf',"$info[Kills] Kills");
        
    imagettftext($my_img130300116$text_colour'fonts/tahoma-bold.ttf',"$info[Deaths] Deaths");
        
    //Coloum 2
        
    imagettftext($my_img13047060$text_colour'fonts/tahoma-bold.ttf',"$info[MoneyBag] Money Bags");
        
    imagettftext($my_img13047079$text_colour'fonts/tahoma-bold.ttf',"$OnlineTime");
        
    imagettftext($my_img13047097$text_colour'fonts/tahoma-bold.ttf',"0 Robberies");
        
    imagettftext($my_img130470116$text_colour'fonts/tahoma-bold.ttf',"$KDRatio K/D Ratio");
        

            
    //Skin ID Image - This here is the second image I want to overlay the first, I found some code but didn't fully understand it.
        
    $skin_link "http://www.codingforums.com/images/skins_large/$info[SkinID].png";
        
    imagecopymerge($my_image$skin_link0000imagesx($my_img), imagesy($my_image), 75);
        
            
    imagesetthickness $my_img);
        
    header"Content-type: image/png" );
        
    imagepng$my_img );
        
    imagecolordeallocate$text_color );
        
    imagecolordeallocate$background );
        
    imagedestroy$my_img );


    Here is what the image looks like now, I would like to have the Image on the right hand side(the player) dynamic and show whatever skin the user has but I can't seem to get the image overlapping to work. Thanks all!
    Last edited by Haydz; 06-13-2014 at 01:43 AM.

  • #2
    New Coder
    Join Date
    Jul 2011
    Location
    New Zealand
    Posts
    34
    Thanks
    11
    Thanked 2 Times in 2 Posts
    little bump .


  •  

    Posting Permissions

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