Code: Select all
<?PHP
$bg = imagecreatefromgif("background.gif");
$h1 = 0;
$h2 = 0;
while ($h1 <= 270) {
$i = imagecreatefromgif("rock.gif");
imagecopymerge($bg, $i, 0, 0, $h1, $h2, 30, 30, 100);
$h2 += 30;
if($h2==300) {
$h2 = 0;
$h1 += 30;
}
}
header("Content-type: image/gif");
imagegif($bg);
imagedestroy($bg);
?>