|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-07-09 10:04 UTC] yannbarrault at yahoo dot fr
I used this function in a script with PHP 4.0.5. It works very well. I installed PHP 4.0.6 and the script doesn't work anymore?
I found that it was this function who didn't work well.
Sorry about my English.
See my script:
<?
Header("Content-type: image/png");
$x=400;
$y=400;
$data=array (3, 1, 7, 2, 5, 4, 6);
$im = imagecreate($x,$y);
$black = ImageColorAllocate($im, 0,0,0);
$blue = ImageColorAllocate($im, 0,36,135);
$white = ImageColorAllocate($im, 255,255,255);
ImageFilledRectangle($im,0,0,$x,$y,$white);
imageline($im,0,50,$x,50,$black);
imageline($im,$x-50,0,$x-50,$y,$black);
for($i=0;$i<sizeof($data);$i++)
{
ImageFilledRectangle($im,$i*50+15,51,$i*50+40,51+$data[$i]*30,$blue);
}
$image=imagecreate(500,500);
imagecopyresized($image,$im,0,0,0,0,400,400,400,400);
Imagepng($image);
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 18:00:01 2025 UTC |
The image result supposed to be a png image like this: ---------------------------|- | | | | | | | | | | | | | | | - | | | | | | | - | | | | | - - | | | - | | | So it is supposed to be a graph with blue rectangles and two black lines, not a black square.