Hello;
I wonder if I can mount an image from other images sequentially.
For example: Let's say that I have a word and image register defined for each letter of the alphabet. When registering a word, Bee for example, I want to create an image from 6 images (A B E L H A). Obs: I do not want to give an imagecreate from a string, I want to create from already defined images.
Solution
$string = "ABELHA";
$len = strlen($string);
$im = imagecreatetruecolor( 60 * $len, 60 );
for( $i = 0; $i < $len; ++$i ) {
$letra = substr( $string, $i, 1 );
$lim= imagecreatefrompng("./$letra.png");
imagecopy ( $im, $lim, $i * 60, 0, 0, 0, 60, 60 );
imagedestroy( $lim );
}
header('Content-Type: image/jpeg');
imagejpeg( $im );
imagedestroy( $im );