note 80851 added to function.imagefilledrectangle
| From: | kyperkins at shadowdev dot com | Date: | Mon, 04 Feb 2008 10:29:55 +0000 |
| Subject: | note 80851 added to function.imagefilledrectangle | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135754@lists.php.net to get a copy of this message | ||
This is a very simple Progress Bar using basic PHP 5.
<?php
#Created by Kyle "KP" Perkins
# of Shadow Development Technologies (http://shadowdev.com)
# on 20080204
#very simple and flexible dynamic PROGRESS BAR
#Used under the Creative Commons Share-Alike License 3.0
#http://creativecommons.org/licenses/by-sa/3.0/us/
#use: index.php?percent/total/width(px)
#example: ?85/100/300
#edit how you like, comments to kyperkins@shadowdev.com
header("Content-type: image/png");
extract($_GET);
$num=explode("/", $s);
$width=$num[2];
$per=($num[0]/$num[1]) * 100;
$percent=round($per, 0);
$im = @imagecreate($width, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 200,200,200);
$text_color = imagecolorallocate($im, 255, 255, 255);
$fill=($percent/100)*$width;
$offset=($width/2)-($width*.02);
imagestring($im, 3, $offset, 5, "$percent%", $text_color);
imagefilledrectangle($im, 0, 0, $fill, 20, imagecolorallocate($im, 0, 0, 255));
imagestring($im, 3, $offset, 5, "$percent%", $text_color);
imagepng($im);
imagedestroy($im);
?>
----
Server IP: 208.69.120.35
Probable Submitter: 152.30.235.54
----
Manual Page -- http://www.php.net/manual/en/function.imagefilledrectangle.php
Edit -- https://master.php.net/note/edit/80851
Del: integrated -- https://master.php.net/note/delete/80851/integrated
Del: useless -- https://master.php.net/note/delete/80851/useless
Del: bad code -- https://master.php.net/note/delete/80851/bad+code
Del: spam -- https://master.php.net/note/delete/80851/spam
Del: non-english -- https://master.php.net/note/delete/80851/non-english
Del: in docs -- https://master.php.net/note/delete/80851/in+docs
Del: other reasons-- https://master.php.net/note/delete/80851
Reject -- https://master.php.net/note/reject/80851
Search -- https://master.php.net/manage/user-notes.php