PDA

View Full Version : PHP GD Help



Moh
01-03-2008, 10:10 PM
Well at the moment, I have a box, with a background and an image above that.
How do I add another image on top of the image and background?
So the layers are:
1) Background
2) Image 1
3) Image 3
The Image 3 has the size of 52x47

My code is;

<?php
header("Content-Type: image/gif");

$habbo = $_GET['habbo'];

$im = imagecreatefrompng("getdjbg.png");
$thumbWidth = "60";
$thumbHeight = "120";
$url = "http://www.habbo.com/habbo-imaging/avatarimage?user=$habbo&action=&direction=4&head_direction=4&gesture=sml&size=l";
$srcImg = imagecreatefrompng($url);
$origWidth = imagesx($srcImg);
$origHeight = imagesy($srcImg);
$thumbImg = imagecreate($thumbWidth, $thumbHeight);

imagecopyresized($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imagesx($thumbImg), imagesy($thumbImg));

$image = imagecopy($im, $thumbImg, 0, -10, 5, 8, 50, 100);

imagegif($im);
imagedestroy($im);
?>
Thanks.

Want to hide these adverts? Register an account for free!