<?php
$points[0] = array(21,25,65,85,75,14,25,65,95);
$points[1] = array(45,63,25,45,12,32,60,12,85);
$points[3] = array(15,74,95,35,12,96,45,25,44);
$image = imagecreate(400, 400);
$bg = imagecolorallocate($image, 255, 255, 255);
$polygonbg = imagecolorallocate($image, 0, 0, 255);
for($i=1; $i<count($points); $i++) {
/* draw */
$num_points = count($points[$i])/2;
imagefilledpolygon($image, $points[$i], $num_points, $polygonbg);
print_r($points[$i]);
}
header('Content-type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
?>
Array ( [0] => 45 [1] => 63 [2] => 25 [3] => 45 [4] => 12 [5] => 32 [6] => 60 [7] => 12 [8] => 85 )
Warning: imagefilledpolygon(): 2nd argument to imagepolygon not an array in /home/gh/public_html/test.php on line 27
idee circa l'errore?![]()