dualzNZ 18 Newbie Poster

Hi all
i am having a small problem with my dynamic output code to produce a signature in php
the signature comes out fine with text but when i add another .png image to add ontop of the main signature i get a black background when i would like it transpearent to show like a users avatar.

my current code to output the signature:

header('Content-Type: image/png');  
    $im = @imagecreatefrompng('sigs/1.png') or die("Cannot select the correct image. Please contact the webmaster."); 
    $text_color = imagecolorallocate($im, 197,197,199); 
	$text_color_red = imagecolorallocate($im, 247,34,6);
    $text_username = "$username";
	$text_mypoints = "Points: ".numberFormat($mypoints)."";
	$text_mypoints1 = usersmypoints($id);
	$text_membertitle = "Member:";
	$text_totalposts = "Total Posts:";
	$text_totalposts_value = totalposts($id);
	$text_url = "http://";
	$outer = "../images/ranks/$tmp.png";
	$src = @imagecreatefrompng($outer);
    $font = 'sigs/arial.ttf'; 
	imagettftext($im, 8, 0, 171, 30, $text_color, $font, $text_membertitle); 
    imagettftext($im, 12, 0, 216, 30, $text_color, $font, $text_username); 
	imagettftext($im, 8, 0, 160, 47, $text_color, $font, $text_totalposts);
	imagettftext($im, 12, 0, 216, 47, $text_color, $font, $text_totalposts_value); 
	imagettftext($im, 7, 0, 15, 72, $text_color, $font, $text_url);   
    imagettftext($im, 10, 0, 10, 95, $text_color_red, $font, $text_mypoints); 
	imagettftext($im, 10, 0, 320, 95, $text_color, $font, $text_mypoints1);
	imagecopymerge($im, $src, 287, 20, 0, 0, 75, 71, 100);
	
    imagepng($im); 
    imagedestroy($im);

the below is the inner image on top of the main generated image

$outer = "../images/ranks/$tmp.png";
	$src = @imagecreatefrompng($outer);

i would like this to show in transparency

thankz

dualzNZ 18 Newbie Poster

SOLVED:

i just needed to add:

$src = @imagecreatefrompng('locationtoimage.png');

then

imagecopymerge($im, $src, 287, 20, 0, 0, 75, 71, 100);
dualzNZ 18 Newbie Poster

hi all

i have created a dynamic signature for a project i am working on
it is working fine but i would like to also pull the users avatar as well to show inside the dynamic signature.

my current dynamic code

<?php  
include("../system/uploadconnection.php");
include("../functions.php");


$username = $_GET['username']; // This gets the player his name from the previous page. 

/* Next, we will make a connection to the mysql.  
If it can't connect, it'll print on the screen: Unable to select database. Be sure the databasename exists and online is. */  


/* To protect MySQL injection. */ 
$username = stripslashes($username); 
$username = mysql_real_escape_string($username); 



$query="SELECT * FROM users WHERE username='$username'"; // Gets all the information about the player. 
$result=mysql_query($query); 
$i=mysql_num_rows($result); // Here we are counting how many rows this result gives us. 

/* We will now put the player's information into variables so we can use them more easily. */ 
/* DON'T FORGET: The names should be exact the same as in your mysql db.*/ 

if ($i == 1) // If the user has been correct, then it'll give us 1 row. If its 1 row, then it'll proceed with the code. 
{ 
         
    $username=mysql_result($result,0,"username"); // Gets the username of the player and put it in the variable $Playername. 
	$mypoints=mysql_result($result,0,"mypoints");
	$id=mysql_result($result,0,"id");
    //$Money=mysql_result($result,0,"Money"); // Gets the money of the player and put it in the variable $Money. 
   // $Score=mysql_result($result,0,"Score"); // Gets the score of the player and put it in the variable $Score. 


    // Creating of the .png image. 
	header('Content-Type: image/png;'); …