note 53703 added to function.imagecolortransparent
| From: | ingrid at osu1 dot php dot net | Date: | Thu, 09 Jun 2005 16:37:17 +0000 |
| Subject: | note 53703 added to function.imagecolortransparent | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90190@lists.php.net to get a copy of this message | ||
This script should take an animated GIF whit a white background transparancy, put some
white=transparant text on it, and can be used in any page using the filename and the normal image
tags.
Everything works well, exept the animation. The GIF animation stands still. Don't know how to
keep the animation animated. Is it possible in PHP?
<?php
$TextFile = "teller.txt";
$Count = trim(file_get_contents($TextFile));
$FP = fopen($TextFile, "r");
$Count=fgets($FP, 4096);
fclose ($FP);
settype($Count, "integer");
$Count++;
if ($FP = fopen ($TextFile, "w")){
fwrite ($FP, $Count);
fclose ($FP);
}
$image = "blad.gif";
$im = imagecreatefromgif($image);
$white = imageColorAllocate ($im, 255, 255, 255);
$trans = imagecolortransparent($im,$white);
$hit = "$Count";
$ip = $_SERVER["REMOTE_ADDR"];
ImageString($im, 2, 30, 60, " je bent bezoeker ", $white);
ImageString($im, 3, 20, 80, " $ip.$hit", $trans);
header("Content-Type: image/gif");
Imagegif($im,'',100);
ImageDestroy ($im);
?>
----
Manual Page -- http://www.php.net/manual/en/function.imagecolortransparent.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53703
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53703&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53703&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53703&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53703&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53703&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53703&report=yes
Search -- http://master.php.net/manage/user-notes.php