\n"; $points[] = round($x,0); $points[] = round($y,0); } $points[] = 200; # insert the center's (x,y) $points[] = 200; return $points; } if ($pic == 1) { header("Content-Type: image/png"); $image = ImageCreate(400, 400); # Make an image 400x400 $yellow = ImageColorAllocate($image, 255,255,0); # Allocate a color $red = ImageColorAllocate($image, 255,0,0); # Allocate a color for($i = 0; $i < $numpolys; $i++) { $points = getpoints($i); ImagePolygon($image, $points, count($points)/2, $red); } # Write the image ImagePNG($image); } else { header("Content-Type: text/html"); echo "

Here's the Imagemap

\n"; echo "\n"; echo "\n"; for($i = 0; $i < $numpolys; $i=$i+1) { $points = getpoints($i); echo "\"Red\n"; } echo "\n"; # The " ends here } ?>