首页 >函数列表 >imagefilledpolygon

imagefilledpolygon

imagefilledpolygon

(PHP 4, PHP 5)

imagefilledpolygon画一多边形并填充

说明

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

imagefilledpolygon()image 图像中画一个填充了的多边形。

points 参数是一个按顺序包含有多边形各顶点的 xy 坐标的数组。

num_points 参数是顶点的总数,必须大于 3。

Example #1 imagefilledpolygon() 例子

<?php
// 建立多边形各顶点坐标的数组
$values = array(
            
40,  50,  // Point 1 (x, y)
            
20,  240// Point 2 (x, y)
            
60,  60,  // Point 3 (x, y)
            
24020,  // Point 4 (x, y)
            
50,  40,  // Point 5 (x, y)
            
10,  10   // Point 6 (x, y)
            
);

// 创建图像
$image imagecreatetruecolor(250250);

// 设定颜色
$bg   imagecolorallocate($image200200200);
$blue imagecolorallocate($image00255);

// 画一个多边形
imagefilledpolygon($image$values6$blue);

// 输出图像
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>


  • gd_info
  • getimagesize
  • image2wbmp
  • imagealphablending
  • imageantialias
  • imagearc
  • imagechar
  • imagecharup
  • imagecolorallocate
  • imagecolorallocatealpha
  • imagecolorat
  • imagecolorclosest
  • imagecolorclosestalpha
  • imagecolorclosesthwb
  • imagecolordeallocate
  • imagecolorexact
  • imagecolorexactalpha
  • imagecolormatch
  • imagecolorresolve
  • imagecolorresolvealpha
  • imagecolorset
  • imagecolorsforindex
  • imagecolorstotal
  • imagecolortransparent
  • imageconvolution
  • imagecopy
  • imagecopymerge
  • imagecopymergegray
  • imagecopyresampled
  • imagecopyresized
  • imagecreate
  • imagecreatefromgd
  • imagecreatefromgd2
  • imagecreatefromgd2part
  • imagecreatefromgif
  • imagecreatefromjpeg
  • imagecreatefrompng
  • imagecreatefromstring
  • imagecreatefromwbmp
  • imagecreatefromxbm
  • imagecreatefromxpm
  • imagecreatetruecolor
  • imagedashedline
  • imagedestroy
  • imageellipse
  • imagefill
  • imagefilledarc
  • imagefilledellipse
  • imagefilledpolygon
  • imagefilledrectangle
  • imagefilltoborder
  • imagefilter
  • imagefontheight
  • imagefontwidth
  • imageftbbox
  • imagefttext
  • imagegammacorrect
  • imagegd
  • imagegd2
  • imagegif
  • imagegrabscreen
  • imagegrabwindow
  • imageinterlace
  • imageistruecolor
  • imagejpeg
  • imagelayereffect
  • imageline
  • imageloadfont
  • imagepalettecopy
  • imagepng
  • imagepolygon
  • imagepsbbox
  • imagepsencodefont
  • imagepsextendfont
  • imagepsfreefont
  • imagepsloadfont
  • imagepsslantfont
  • imagepstext
  • imagerectangle
  • imagerotate
  • imagesavealpha
  • imagesetbrush
  • imagesetpixel
  • imagesetstyle
  • imagesetthickness
  • imagesettile
  • imagestring
  • imagestringup
  • imagesx
  • imagesy
  • imagetruecolortopalette
  • imagettfbbox
  • imagettftext
  • imagetypes
  • imagewbmp
  • imagexbm
  • image_type_to_extension
  • image_type_to_mime_type
  • iptcembed
  • iptcparse
  • jpeg2wbmp
  • png2wbmp
  • PHP MySQL HTML CSS JavaScript MSSQL AJAX .NET JSP Linux Mac ASP 服务器 SQL jQuery C# C++ java Android IOS oracle MongoDB SQLite wamp 交通频道