Jump to content

[SOLVED] Dynamic Signature


GamingWarrior

Recommended Posts

Ok, i'm making a dynamic sig for The new quake wars. I have had no problems getting all the information from the xml page but now making the sig part i have hit a wall.

Basically i have this so far

QWETS.png

but i want to add Lance%20Corporal.png or wat eva maybe tmy current rank at the time to the right hand side of the sig. but cant workout how to print an image.

this is my code so far(I have removed the code which i used to get the values as its very messy and not relevant)

 

 


<?PHP

$image = $classusedmost . ".png";

$font = 5;
$im = @imagecreatefrompng($image);



$image_text = array(
        'x'     => 148,
        'y'     => 70,
        'color' => array(50, 100, 180),
        'font'  => 9,
        'text'  => $Rankno
    );

$image_text2 = array(
        'x'     => 250,
        'y'     => 70,
        'color' => array(50, 100, 180),
        'font'  => 9,
        'text'  => $Score
    );



    $fgColor = imagecolorallocate($im, 255, 255, 255);


        header('Content-Type: image/png');

	imagestring($im, $font, $image_text['x'], $image_text['y'], $image_text['text'], $fgColor);
	imagestring($im, $font, $image_text2['x'], $image_text2['y'], $image_text2['text'], $fgColor);
	imagepng($im);
	imagedestroy($im);
?>

any help would be great :)

-GamingWarrior

Link to comment
Share on other sites

ok, i think i may have found the fuction i need to use but have no clue how to you it :(

The function is imageCopyMerge() basically i should be able to use that to join the two images the only problem is al the examples using it are for overlaying two images. but I'll keep looking but if some know how i could do this help is very welcome :)

Link to comment
Share on other sites

TA-DA

sig2.png

  $rankim = 'Ranks/' . $Rank . '.png';
  $main = imagecreatefrompng("http://1337gamerz.recoding.net/sig1.png");
  $rank = imagecreatefrompng("$rankim");
  imagecopymerge($main, $rank, 306, 0, 0, 0, 90, 90, 100);
  header('Content-type: image/png');
  imagepng($main);
  imagedestroy($main);
  imagedestroy($rank);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.