mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 22:38:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@146654 c90b9560-bf6c-de11-be94-00142212c4b1
93 lines
2.5 KiB
XML
93 lines
2.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<!-- splitted from ./en/functions/image.xml, last change in rev 1.2 -->
|
|
<refentry id="function.imagefilledpolygon">
|
|
<refnamediv>
|
|
<refname>imagefilledpolygon</refname>
|
|
<refpurpose>Draw a filled polygon</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>imagefilledpolygon</methodname>
|
|
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>points</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>num_points</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>color</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>imagefilledpolygon</function> creates a filled polygon
|
|
in image <parameter>image</parameter>.
|
|
<parameter>points</parameter> is a PHP array containing the
|
|
polygon's vertices, i.e. points[0] = x0, points[1] = y0, points[2]
|
|
= x1, points[3] = y1, etc. <parameter>num_points</parameter> is
|
|
the total number of vertices.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>imagefilledpolygon</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// this example is provided by ecofarm at mullum dot com dot au
|
|
|
|
// set up array of points for polygon
|
|
$values = array(
|
|
0 => 40, // x1
|
|
1 => 50, // y1
|
|
2 => 20, // x2
|
|
3 => 240, // y2
|
|
4 => 60, // x3
|
|
5 => 60, // y3
|
|
6 => 240, // x4
|
|
7 => 20, // y4
|
|
8 => 50, // x5
|
|
9 => 40, // y5
|
|
10 => 10, // x6
|
|
11 => 10, // y6
|
|
);
|
|
|
|
// create image
|
|
$im = imagecreate(250, 250);
|
|
|
|
// some colors
|
|
$bg = imagecolorallocate($im, 255, 255, 255);
|
|
$blue = imagecolorallocate($im, 0, 0, 255);
|
|
|
|
// draw a polygon
|
|
imagefilledpolygon($im, $values, 6, $blue );
|
|
|
|
// flush image
|
|
header('Content-type: image/png');
|
|
imagepng($im);
|
|
imagedestroy($im);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|