I'm trying to create a Image with PHP.
With PNG it works pretty well (The Font Colors works!).
But if I'm using GIF, the Fonts dont get Colors (Always white).
And the GIF Image I use for the Background is not Animated!
This is how it works in PNG (Font Color):
<?php
$zeile1 = @file_get_contents('zeile1.txt');
$zeile1_title = @file_get_contents('zeile1_title.txt');
$image = imagecreatefrompng("bg_text.png");
imagesavealpha($image, true);
imagealphablending($image, true);
$finalImage = imagecreatetruecolor(391,300);
$font = '../banner1/arial.ttf';
$color = imagecolorallocate($finalImage, 0, 0, 0);
$font_title = '../banner1/arialbd.ttf';
$color_title = imagecolorallocate($finalImage, 255, 0, 126);
imagettftext($image, 15, 0, 2, 130, $color, $font, $zeile1);
imagettftext($image, 25, 0, 2, 130, $color_title, $font_title, $zeile1_title);
header('Content-type: image/png');
imagepng($image);
?>
But now I want a animated gif as background:
<?php
$zeile1 = @file_get_contents('zeile1.txt');
$zeile1_title = @file_get_contents('zeile1_title.txt');
$image = imagecreatefromgif("bg_text.gif");
imagesavealpha($image, true);
imagealphablending($image, true);
$finalImage = imagecreatetruecolor(391,300);
$font = '../banner1/arial.ttf';
$color = imagecolorallocate($finalImage, 0, 0, 0);
$font_title = '../banner1/arialbd.ttf';
$color_title = imagecolorallocate($finalImage, 255, 0, 126);
imagettftext($image, 15, 0, 2, 130, $color, $font, $zeile1);
imagettftext($image, 25, 0, 2, 130, $color_title, $font_title, $zeile1_title);
header('Content-type: image/gif');
imagegif($image);
?>
Now the Text is only white and the Title text, is not Showing + The image is not animated.
I hope you understand what I mean, because my english is bad :/