
Untitled
By: a guest on
Jul 6th, 2012 | syntax:
None | size: 0.55 KB | hits: 10 | expires: Never
Montage or Collage with GD Library
$montage_image = imagecreatetruecolor(100, 100);
$x_index = 0;
$y_index = 0;
foreach($array_with_100_10x10_gif_urls as $gif_image_url) {
$current_image = imagecreategif($gif_image_url);
imagecopy($montage_image, $current_image, $x_index * 10, $y_index * 10, 0, 0, 10, 10);
imagedestroy($current_image);
$x_index++;
if ($x_index > 9) {
$x_index = 0;
$y_index++;
}
}
// place code for saving the montage image as a file or outputting to teh browser here.
imagedestroy($montage_image);