1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| <?php
header("Content-type: image/png");
session_start();
$valmax = $_SESSION['identite'][0];
$escal=$valmax+$valmax/10;
$img = imagecreatefrompng("graf.png");
$rouge = imagecolorallocate($img,255, 0, 0);
for($a=9; $a<409; $a=$a+40)
{
$escal=$escal-$valmax/10;
$stringa=(string)$escal;
$px = 40 - (7.5 * strlen($stringa));
imagestring($img, 3, $px, $a, $stringa, 0);
}
$refx=48;
$largx=800;
$refy=413;
$npt=$refy-15;
$grad=($largx)/24;
$vapty=$valmax/$npt;
for ($m=-1;$m<5;$m++);
{
$x1=($m*$grad)+$refx;
$x2=(($m+1)*$grad)+$refx;
$y1=$refy-(($_SESSION['identite'][2][$m])/$vapty);
$y2=$refy-(($_SESSION['identite'][2][$m+1])/$vapty);
imageline($img,$x1,$y1,$x2,$y2,$rouge);
}
imagepng($img);
imagedestroy($img);
?> |
Partager