Home > PHP > Function > GD > imagefilledpolygon()

imagefilledpolygon()

imagefilledpolygon - Draw a filled polygon

Syntax

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

Arguments

  • image - An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().
  • points - An array containing the xand ycoordinates of the polygons vertices consecutively.
  • num_points - Total number of vertices, which must be at least 3.
  • color - A color identifier created with imagecolorallocate().

Description

imagefilledpolygon() creates a filled polygon in the given image.

Version

PHP 4, 5

Return value

Returns TRUE on success or FALSE on failure.