note 80584 added to function.imageline
| From: | sow dot olivier at free dot fr | Date: | Wed, 23 Jan 2008 15:45:58 +0000 |
| Subject: | note 80584 added to function.imageline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135338@lists.php.net to get a copy of this message | ||
//a function to draw circular purcentage
function drawPurcent($purcent, $rayon=16)
{
header("Content-type: image/png");
$drawPurcent_WIDTH=$rayon; $drawPurcent_HEIGHT=$rayon;
$img=imagecreate($drawPurcent_WIDTH,$drawPurcent_HEIGHT);
$background_color=imagecolorallocate($img, 255, 0, 0);
$fore_color=imagecolorallocate($img, 0, 0, 0);
$p100_color=imagecolorallocate($img, 255, 255, 255);
for( $i=0; $i<=360 ; $i++) {#
if($i<360/100*$purcent) {#
imageline($img,
$drawPurcent_WIDTH/2,
$drawPurcent_HEIGHT/2,
cos(deg2rad($i))*$drawPurcent_WIDTH/2 +$drawPurcent_WIDTH/2,
sin(deg2rad($i))*$drawPurcent_HEIGHT/2 +$drawPurcent_HEIGHT/2,
$fore_color
);
}
else {#
imageline($img,
cos(deg2rad($i))*$drawPurcent_WIDTH/2 +$drawPurcent_WIDTH/2,
sin(deg2rad($i))*$drawPurcent_HEIGHT/2 +$drawPurcent_HEIGHT/2,
cos(deg2rad($i))*$drawPurcent_WIDTH/2 +$drawPurcent_WIDTH/2,
sin(deg2rad($i))*$drawPurcent_HEIGHT/2 +$drawPurcent_HEIGHT/2,
$fore_color
);
}
}
if($purcent==100) {#
imageline($img,0,0,$rayon,$rayon,$p100_color);
imageline($img,0,$rayon,$rayon,0,$p100_color);
}
imagecolortransparent($img,$background_color);
imagepng($img);
imagedestroy($img);
}//function
----
Server IP: 69.147.83.197
Probable Submitter: 81.251.118.84
----
Manual Page -- http://www.php.net/manual/en/function.imageline.php
Edit -- https://master.php.net/note/edit/80584
Del: integrated -- https://master.php.net/note/delete/80584/integrated
Del: useless -- https://master.php.net/note/delete/80584/useless
Del: bad code -- https://master.php.net/note/delete/80584/bad+code
Del: spam -- https://master.php.net/note/delete/80584/spam
Del: non-english -- https://master.php.net/note/delete/80584/non-english
Del: in docs -- https://master.php.net/note/delete/80584/in+docs
Del: other reasons-- https://master.php.net/note/delete/80584
Reject -- https://master.php.net/note/reject/80584
Search -- https://master.php.net/manage/user-notes.php