0
Hello;
I wonder if I can mount an image from other images sequentially.
For example: Let’s say I have a register of words and images 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 don’t 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 );
Hi Bacco, in this specific situation I have not tried anything yet, I have generated image from a text for example (captcha), but not in this way as I described. I searched the image commands in PHP and what I found were commands that merge image basically, so I wanted to know if it is possible.
– Reji
I practically made the essential for you, and posted as an answer. Of course it will need adjustments, but the essential is there.
– Bacco