以下の内容はhttps://www.weblio.jp/content/imagepolygonより取得しました。


PHP Documentation GroupPHP Documentation Group

imagepolygon

(PHP 4, PHP 5)
imagepolygon — 多角形を描画する

説明

bool imagepolygon ( resource image, array points, int num_points, int color )
imagepolygon() は、指定した image に多角形を作成します。

パラメータ

image
imagecreatetruecolor() のような画像作成関数が返す画像リソース。
points
多角形の頂点からなる PHP の配列で、 points[0] = x0, points[1] = y0, points[2] = x1, points[3] = y1 というようになります。
num_points
頂点の総数。
color
imagecolorallocate() で作成した色 ID。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例 939. imagepolygon() の例
<?php
// 空の画像を生成します
$image = imagecreatetruecolor(400, 300);

// 背景色を塗ります
$bg = imagecolorallocate($image, 0, 0, 0);

// 多角形の色を選択します
$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);

?>
上の例の出力は、たとえば 以下のようになります。
imagepolygon

参考

imagecreate()
imagecreatetruecolor()






以上の内容はhttps://www.weblio.jp/content/imagepolygonより取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14