Kreslenie polygónov pomocou GD.

<? 
$im = ImageCreate(301, 301); 
$bgc = ImageColorAllocate($im,255,255,255); 
$tc = ImageColorAllocate($im,0,0,0); 
 
$points=array(0, 100, 0, 300, 300, 300, 300, 100, 0, 100, 150, 0, 300, 100); 
 
//ImagePolygon(image, points, points count, color); 
ImagePolygon($im, $points, count($points)/2, $tc); 
// skús ImageFilledPolygon 
 
Header("Content-type: image/gif"); 
ImageGif($im); 
?>