imagepolygon

(PHP 4, PHP 5, PHP 7)

imagepolygon锟斤拷一锟斤拷锟斤拷锟斤拷锟�

说锟斤拷

imagepolygon ( resource $image , array $points , int $num_points , int $color ) : bool

imagepolygon() 锟斤拷图锟斤拷锟叫达拷锟斤拷一锟斤拷锟斤拷锟斤拷巍锟�points 锟斤拷一锟斤拷 PHP 锟斤拷锟介,锟斤拷锟斤拷锟剿讹拷锟斤拷蔚母锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷辏拷锟� points[0] = x0锟斤拷points[1] = y0锟斤拷points[2] = x1锟斤拷points[3] = y1锟斤拷锟皆达拷锟斤拷锟狡★拷num_points 锟角讹拷锟斤拷锟斤拷锟斤拷锟斤拷锟�

Example #1 imagepolygon() 锟斤拷锟斤拷

<?php
// create a blank image
$image imagecreatetruecolor(400300);

// fill the background color
$bg imagecolorallocate($image000);

// choose a color for the polygon
$col_poly imagecolorallocate($image255255255);

// draw the polygon
imagepolygon($image,
             array (
                    
00,
                    
100200,
                    
300200
             
),
             
3,
             
$col_poly);

// output the picture
header("Content-type: image/png");
imagepng($image);

?>

锟轿硷拷 imagecreate() 锟斤拷 imagecreatetruecolor()锟斤拷