Home > PHP > Function > GD > imagepolygon()

imagepolygon()

imagepolygon - Draws a polygon

Syntax

bool imagepolygon (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 polygon\'s vertices, e.g.: points[0] = x0 points[1] = y0 points[2] = x1 points[3] = y1
  • num_points - Total number of points (vertices).
  • color - A color identifier created with imagecolorallocate().

Description

imagepolygon() creates a polygon in the given image.

Version

PHP 4, 5

Return value

Returns TRUE on success or FALSE on failure.