note 39239 added to function.imagefilledpolygon
| From: | topace at lightbox dot org | Date: | Wed, 21 Jan 2004 18:11:43 +0000 |
| Subject: | note 39239 added to function.imagefilledpolygon | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63971@lists.php.net to get a copy of this message | ||
The above comment states that the maximum points is 256. This is untrue in PHP 4.3.4, using the
built-in GD. The following produces a pretty picture with 10000 points. (and I've tested it up
to 100000 points)
<?php
$im = imagecreate(2000, 2000);
$bg = imagecolorallocate($im, 255, 255, 255);
$blue = imagecolorallocate($im, 0, 0, 255);
$numpoints=10000;
for($x=0;$x<$numpoints*2;$x+=2)
{
$values[$x]=rand(1,2000);
$values[$x+1]=rand(1,2000);
}
imagefilledpolygon($im, $values, $numpoints, $blue );
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
----
Manual Page -- http://www.php.net/manual/en/function.imagefilledpolygon.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39239
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39239&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39239&report=yes
Search -- http://master.php.net/manage/user-notes.php