DemonGal711 8 Junior Poster

Alright, I found this code online which basically solved my issues.

<?php

header ('Content-type:image/gif');
include('GIFEncoder.class.php');

$text = "Hello World";

// Open the first source image and add the text.
$image = imagecreatefrompng('source01.png');
$text_color = imagecolorallocate($image, 200, 200, 200);
imagestring($image, 5, 5, 5,  $text, $text_color);

// Generate GIF from the $image
// We want to put the binary GIF data into an array to be used later,
//  so we use the output buffer.
ob_start();
imagegif($image);
$frames[]=ob_get_contents();
$framed[]=40; // Delay in the animation.
ob_end_clean();

// And again..

// Open the first source image and add the text.
$image = imagecreatefrompng('source02.png');
$text_color = imagecolorallocate($image, 200, 200, 200);
imagestring($image, 5, 20, 20,  $text, $text_color);

// Generate GIF from the $image
// We want to put the binary GIF data into an array to be used later,
//  so we use the output buffer.
ob_start();
imagegif($image);
$frames[]=ob_get_contents();
$framed[]=40; // Delay in the animation.
ob_end_clean();

// Generate the animated gif and output to screen.
$gif = new GIFEncoder($frames,$framed,0,2,0,0,0,'bin');
echo $gif->GetAnimation();

?>

Now, it creates the image within this script. If I already have the images created in a different script, can I just remove the things that relate the the image in here and tell it to just grab that image to use. Not exactly include 'image1.php'; cause that won't work, but something along those lines.

If not, is it possible for me to create two functions for it to call to get the image or would that not work also?

Or, since I'm just updating a string in my image, can I have it call a function to get the new string and then have it fill in the function that way?