The
GmagickDraw::polyline() function is an inbuilt function in PHP which is used to draw a polyline using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates.
Syntax:
GmagickDraw GmagickDraw::polyline( array $coordinates_array )
Parameters: This function accepts a single parameter
$coordinates_array which is used to hold the coordinates of the point as an array.
Return Value: This function returns GmagickDraw object on success.
Exceptions: This function throws GmagickDrawException on error.
Used Image: 👁 Image
Below examples illustrate the
GmagickDraw::polyline() function in PHP:
Program 1: Drawing over an image
Output:
👁 Image
Program 2: Drawing from scratch
Output:
👁 Image
Reference: https://www.php.net/manual/en/gmagickdraw.polyline.php