PHP imagepolygon ( ) FunctionThe image polygon ( ) function is one more inbuilt PHP work basically used to draw a polygon with absolutely given coordinates. This capacity works utilizing the x and y axis that are automatically derived by the PHP compiler, all we have to do is to set organizes for the beginning stage from where the image must be drawn. The beginning directions also called the origin (0, 0) are in the perusing window's upper left corner. You can set the directions in like manner from the beginning to get the subsequent polygon as per our necessities. This function returns a Boolean value which validates a true on successful progression and a false validation on disapproval Syntax:Parameters: This function accepts various parameters; which are as follows:
The image arc ( ) function returns TRUE on successful execution of the program and FALSE on a failed attempt. Program 1: PHP program to display the use of imagepolygon ( ) function to draw a polygon Output: In the above program, we have pronounced different factors like $image to stamp out the size of the picture that we require, $background variety to check out the shade of foundation we require, $text variety to stamp out the shade of text we require, a cluster $values to set the directions of the polygon we want to proclaim, and we have utilized the image polygon ( ) capacity to show the polygon we need to show as a picture, to show the result of the picture we have utilized an inbuilt PHP order header and image png to show in the program. Program 2: PHP program to display the use of imagepolygon ( ) function to draw a polygon Output: Here in this program, we have announced different factors like $image to stamp out the size of the picture that we require, $background variety to check out the shade of foundation we require, $text variety to stamp out the shade of text we require, an exhibit $values to set the directions of the polygon we want to proclaim, and we have utilized image polygon ( ) to show the polygon we need to show as a picture, to show the result of the picture we have utilized an inbuilt PHP order header and image png to show on program. Program 3: Basic PHP program to display the use of imagepolygon ( ) function to draw a polygon Output: Here, in the above program, we have pronounced different factors like $image to characterize the size of the picture that we require, $background variety to characterize the shade of foundation we require, $text variety to characterize the shade of text we require, an exhibit $values to set the directions of the polygon we want to proclaim, and we have utilized image polygon ( ) to show the polygon we need to show as a picture, to show the result of the picture we have utilized an inbuilt PHP order header and image png to show on program. Next TopicFree PHP Web Hosting |