Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

imagefilledpolygon function syntax tag tutorial 2013 Donate at flattr Flattr this

Alert! Connect with 10,000 Chating Online. Join Now

Php imagefilledpolygon () function

Write your php code

<?php ?>

Php Result

Your code below

(PHP 3, PHP 4 , PHP 5)

imagefilledpolygon -- Draw a filled polygon


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

imagefilledpolygon() creates a filled polygon in image image.

points is an array containing the x and y co-ordinates of the polygons vertices consecutively.

The parameter num_points is the total number of vertices, which must be larger than 3.

Example 1. imagefilledpolygon() example

// set up array of points for polygon
$values = array(
40,  50,  // Point 1 (x, y)
20,  240, // Point 2 (x, y)
60,  60,  // Point 3 (x, y)
240, 20,  // Point 4 (x, y)
50,  40,  // Point 5 (x, y)
10,  10   // Point 6 (x, y)

// create image
$image = imagecreate(250, 250);

// some colors
$bg   = imagecolorallocate($image, 200, 200, 200);
$blue = imagecolorallocate($image, 0, 0, 255);

// draw a polygon
imagefilledpolygon($image, $values, 6, $blue);

// flush image
header('Content-type: image/png');

Php imagefilledpolygon Function syntax tag

imagefilledpolygon php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online

Php imagefilledpolygon syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.

Function index







Date & Time

Directory function




Form data handling

Mathematics operators


Php Mysql

Network Functions


php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online