IMAGEPOLYGON(3) 1 IMAGEPOLYGON(3)imagepolygon - Draws a polygonSYNOPSIS
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 drawingSYNOPSIS
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)