note 60285 added to function.imagepolygon
| From: | gerardw at alum dot mit dot edu | Date: | Mon, 02 Jan 2006 02:52:00 +0000 |
| Subject: | note 60285 added to function.imagepolygon | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101096@lists.php.net to get a copy of this message | ||
The example given doesn't seem to actually set the background image (it defaults to black
without being set.)
This slightly modified example draws black on white:
<?php
// create a blank image
$image = imagecreatetruecolor(400, 300);
// fill the background color
$bg = imagecolorallocate($image, 255, 255, 255);
imagefill($image,0,0,$bg); //<-- added this
// choose a color for the polygon
$col_poly = imagecolorallocate($image, 0, 0, 0);
// draw the polygon
imagepolygon($image,
array (
0, 0,
100, 200,
300, 200
),
3,
$col_poly);
// output the picture
header("Content-type: image/png");
imagepng($image);
?>
----
Manual Page -- http://www.php.net/manual/en/function.imagepolygon.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60285
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60285&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60285&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60285&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60285&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60285&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60285&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60285&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60285&report=yes
Search -- http://master.php.net/manage/user-notes.php