<?php
// 空の画像を生成します
$image = imagecreatetruecolor(400, 300);
// 多角形の色を選択します
$col_poly = imagecolorallocate($image, 255, 255, 255);
// 多角形を描画します
imagepolygon($image, array(
0, 0,
100, 200,
300, 200
),
3,
$col_poly);
// 画像を出力します
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>