Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

imagepolygon(3) [php man page]

IMAGEPOLYGON(3) 							 1							   IMAGEPOLYGON(3)

imagepolygon - Draws a polygon

SYNOPSIS
bool imagepolygon (resource $image, array $points, int $num_points, int $color) DESCRIPTION
imagepolygon(3) creates a polygon in the given $image. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $points - An array containing the polygon's vertices, e.g.: +----------+------+ |points[0] | | | | | | | = x0 | | | | |points[1] | | | | | | | = y0 | | | | |points[2] | | | | | | | = x1 | | | | |points[3] | | | | | | | = y1 | | | | +----------+------+ o $num_points - Total number of points (vertices). o $color - A color identifier created with imagecolorallocate(3). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 imagepolygon(3) example <?php // Create a blank image $image = imagecreatetruecolor(400, 300); // Allocate a color for the polygon $col_poly = imagecolorallocate($image, 255, 255, 255); // Draw the polygon imagepolygon($image, array( 0, 0, 100, 200, 300, 200 ), 3, $col_poly); // Output the picture to the browser header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagepolygon() SEE ALSO
imagecreate(3), imagecreatetruecolor(3). PHP Documentation Group IMAGEPOLYGON(3)

Check Out this Related Man Page

IMAGESETBRUSH(3)							 1							  IMAGESETBRUSH(3)

imagesetbrush - Set the brush image for line drawing

SYNOPSIS
bool imagesetbrush (resource $image, resource $brush) DESCRIPTION
imagesetbrush(3) sets the brush image to be used by all line drawing functions (such as imageline(3) and imagepolygon(3)) when drawing with the special colors IMG_COLOR_BRUSHED or IMG_COLOR_STYLEDBRUSHED. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $brush - An image resource. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 imagesetbrush(3) example <?php // Load a mini php logo $php = imagecreatefrompng('./php.png'); // Create the main image, 100x100 $im = imagecreatetruecolor(100, 100); // Fill the background with white $white = imagecolorallocate($im, 255, 255, 255); imagefilledrectangle($im, 0, 0, 299, 99, $white); // Set the brush imagesetbrush($im, $php); // Draw a couple of brushes, each overlaying each imageline($im, 50, 50, 50, 60, IMG_COLOR_BRUSHED); // Output image to the browser header('Content-type: image/png'); imagepng($im); imagedestroy($im); imagedestroy($php); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagesetbrush() NOTES
Note You need not take special action when you are finished with a brush, but if you destroy the brush image, you must not use the IMG_COLOR_BRUSHED or IMG_COLOR_STYLEDBRUSHED colors until you have set a new brush image! PHP Documentation Group IMAGESETBRUSH(3)
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Capture Value from file

I have a file in the following Format Fundid: 100-BankA AccountNumber Balance 1 200 2 300 3 400 FundId:123321-BankB AccountNumber Balance 1 200 3 100 ........... I can have N number of funds. (1 Reply)
Discussion started by: kris01752
1 Replies

2. UNIX for Advanced & Expert Users

Create an Ignite image on tape from Online IgniteUX image

Hi, (HP-UX 11.11) I need to create a tape image of an igniteUX image created on our igniteUX server. That is to say. I have a "Online" image of the igniteUX of the targeted system but I now need to copy it to a useable TAPE (igniteUX) image so i can build an other server from it that is not... (3 Replies)
Discussion started by: Andrek
3 Replies

3. Shell Programming and Scripting

Grouping and summing data through unix

Hi everyone, I need a help on Unix scripting. I have a file is like this Date Amt 20071205 10 20071204 10 20071203 200 20071204 300 20071203 400 20071205 140 20071203 100 20071205 100... (1 Reply)
Discussion started by: pcharanraj
1 Replies

4. Shell Programming and Scripting

calculate from three files

Hi all I have 3 three files like: file1: 1|100 2|200 3|300 4|400 5|500 file2: 1|200 2|200 3|600 4|800 file3: 1|300 2|100 (5 Replies)
Discussion started by: koti_rama
5 Replies

5. UNIX for Advanced & Expert Users

Grep all the columns based on a particular column

This is the data file that I have 21879, 0, 22, 58, 388 0, -1, 300, 1219172589765, 1708, 0, 200, 21891, 0, 0, 33, 309 0, -1, 300, 1219172591478, 1768, 0, 200, 22505, 0, 0, 33, 339 0, -1, 300, 1219172593251, 1738, 0, 200, 21888, 0, 1, 33, 308 0, -1, 300, 1219172594995, 633, 0, 200, 24878,... (2 Replies)
Discussion started by: pmallur
2 Replies

6. UNIX for Dummies Questions & Answers

Arrange data

I have a following data: 100 200 300 400 I want the data to be arranged: 100 200 300 400 What is the best way to do this? Thanks! (5 Replies)
Discussion started by: bobo
5 Replies

7. Linux

error while retrieving image using system imager

This is the error that I am getting while retrieving image from image server using system imager.... Listening on LPF/lo/<null> sending on Socket/fallback/fallback-net DHCPDISCOVER on lo to 255.255.255.255 port 67 interval 5 DHCPDISCOVER on lo to 255.255.255.255 port 67 interval5... (1 Reply)
Discussion started by: nitesh_tarbani
1 Replies

8. Shell Programming and Scripting

Aggregated points

Combine points of specific key (a1) based on user defined size (lets say 200 in this example). so a1 191 and 191+200 and sum of all the values (4th column) and vice versa... Thanx a bunch! a1 191 201 1 a1 201 211 2 a1 211 221 1 a1 ....... .... a2......... ........ (7 Replies)
Discussion started by: quincyjones
7 Replies

9. Shell Programming and Scripting

average of distinct values with awk

Hi guys, I am not an expert in shell and I need help with awk command. I have a file with values like 200 1 1 200 7 2 200 6 3 200 5 4 300 3 1 300 7 2 300 6 3 300 4 4 I need resulting file with averages of... (3 Replies)
Discussion started by: saif
3 Replies

10. UNIX for Dummies Questions & Answers

Need help filling in ranges

I have a list of about 200,000 lines in a text file that look like this: 1 1 120 1 80 200 1 150 270 5 50 170 5 100 220 5 300 420 The first column is an identifier, the next 2 columns are a range (always 120 value range) I'm trying fill in the values of those ranges, and remove... (4 Replies)
Discussion started by: knott76
4 Replies

11. UNIX for Dummies Questions & Answers

To compare first two columns in an excel file

Hi All, i have a excel sheet with two columns as below. column1 column2 100 100 200 300 300 400 400 400 500 600 i need to compare the values these two columns and the output should be printed in the third column...if these values are equal the output should be green and if these... (2 Replies)
Discussion started by: arunmanas
2 Replies

12. Shell Programming and Scripting

AWK: Grep Pattern and print help

I wanted to get outcome from a big file with pattern quoted: Line FSP LSP SR RL Test1 100 300 4 4000 Test2 1 300 2 300 Any help is greatly appreciated. Thank you. (15 Replies)
Discussion started by: rtsiahaan
15 Replies

13. Shell Programming and Scripting

Replace Contents from One file into another

Hi Friends, I have two input files cat input1 chr1 100 200 chr1 200 300 chr2 300 400 cat input2 chr1 hello monday 10 20 . - . sometext chr1 hello monday 20 30 . - . sometext chr2 hello monday 30 40 . - . sometext Now, I want to replace $1, $4 and $5 of input2 with $1, $2 and... (1 Reply)
Discussion started by: jacobs.smith
1 Replies

14. UNIX for Dummies Questions & Answers

Writing a dummy line!!

Hi, I have a file whihc looks like file_1 100 200 file_2 200 300 file_4 400 500 as the file_3 is missing so I want to replace it by file_3 0 0 the final output would look like file_1 100 200 file_2 200 300 file_3 0 0 file_4 400 500 Any help is highly appreciated. Regards, (3 Replies)
Discussion started by: begin_2013
3 Replies