le 26/11/2008 à 21:22
Fusionner 2 images avec LibarieGD
Oui j'ai du mal avec le positionnement :(
En tout cas, je te remercie beaucoup, tu m'as vachement aider !
En tout cas, je te remercie beaucoup, tu m'as vachement aider !
<?php
$habbo = $_GET['habbo1'];
$habbo2 = $_GET['habbo2'];
$im = imagecreatetruecolor(185, 178);
$bg = imagecolorallocate($im, 255, 255, 255);
$font = "volterb.ttf";
imagefill($im,0,0,$bg);
imagecolortransparent($im, $bg);
$im = imagecreatefromgif("profile.gif");
$fig1 = "http://www.habbo.fr/habbo-imaging/avatarimage?user=$habbo&action=std&direction=1&head_direction=1&gesture=eyb&size=l&img_format=gif";
$fig2 = "http://www.habbo.fr/habbo-imaging/avatarimage?user=$habbo2&action=std&direction=5&head_direction=5&gesture=eyb&size=l&img_format=gif";
$figure1 = imagecreatefromgif($fig1);
$figure2 = imagecreatefromgif($fig2);
$fig1y = imagesy($figure1);
$fig1x = imagesx($figure1);
$fig2y = imagesy($figure2);
$fig2x = imagesx($figure2);
imagecopy($im, $figure1, 45, 70, 0, 0, $fig1x, $fig1y);
imagecopy($im, $figure2, 75, 70, 0, 0, $fig2x, $fig2y);
imagefttext($im, 75, 90, 0, 0, $bg, $font, "Guese");
header("Content-type: image/gif");
imagegif($im);
imagedestroy($im);
?>
<?php
header("Content-type: image/gif");
$habbo = $_GET['habbo1'];
$habbo2 = $_GET['habbo2'];
$im = imagecreatetruecolor(185, 178);
$bg = imagecolorallocate($im, 255, 255, 255);
imagefill($im,0,0,$bg);
imagecolortransparent($im,$bg);
$im = imagecreatefromgif("profile.gif");
$fig1 = "http://www.habbo.fr/habbo-imaging/avatarimage?user=$habbo&action=std&direction=1&head_direction=1&gesture=sml&size=l&img_format=gif";
$fig2 = "http://www.habbo.fr/habbo-imaging/avatarimage?user=$habbo2&action=std&direction=5&head_direction=5&gesture=sml&size=l&img_format=gif";
$figure1 = imagecreatefromgif($fig1);
$figure2 = imagecreatefromgif($fig2);
$fig1y = imagesy($figure1);
$fig1x = imagesx($figure1);
$fig2y = imagesy($figure2);
$fig2x = imagesx($figure2);
imagecopy($im, $figure1, -5, -5, 0, 0, $fig1x, $fig1y);
imagecopy($im, $figure2, 25, -5, 0, 0, $fig2x, $fig2y);
imagegif($im);
imagedestroy($im);
?>
Chargement en cours