Question

I'm trying to dynamically generate an image file that will be composed by other smaller images. This is the code I've got so far

    if ( function_exists('imagecreate') ) {
        header ("Content-type: image/png");
        $im = @imagecreate ($imgWidth, $imgHeight)
            or die ("Cannot initialize new GD image stream");
        $background_color = imagecolorallocate ($im, 255, 255, 255);
        $text_color = imagecolorallocate ($im, 0,0,0);
        imagepng ($im);
        imagedestroy($im);
    }

So far, it's working fine. I just can't figure out how to include my smaller images into this new, bigger, dynamically generated image. Does anyone know how to do this? Ideally, the function that does this (or whatever it is) would ask me for the image file, it's x and y positions in the second image file.

Any suggestions? I sincerely appreciate any help you can bring me. Thank you so so much!!

Was it helpful?

Solution

Imagecopymerge is probably what you are looking for

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top