<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.imageopenpolygon.php',
    1 => 'imageopenpolygon',
    2 => 'Draws an open polygon',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD- und Image-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.imageloadfont.php',
    1 => 'imageloadfont',
  ),
  'next' => 
  array (
    0 => 'function.imagepalettecopy.php',
    1 => 'imagepalettecopy',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imageopenpolygon.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imageopenpolygon" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imageopenpolygon</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.2.0, PHP 8)</p><p class="refpurpose"><span class="refname">imageopenpolygon</span> &mdash; <span class="dc-title">Draws an open polygon</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imageopenpolygon-description">
  <h3 class="title">Beschreibung</h3>
  <p class="simpara">Signature as of PHP 8.0.0 (not supported with named arguments)</p>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imageopenpolygon</strong></span>(<span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$image</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$points</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$color</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">Alternative signature (deprecated as of PHP 8.1.0)</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>imageopenpolygon</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$image</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$points</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$num_points</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$color</code></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imageopenpolygon()</strong></span> draws an open polygon on the given
   <code class="parameter">image</code>. Contrary to <span class="function"><a href="function.imagepolygon.php" class="function">imagepolygon()</a></span>,
   no line is drawn between the last and the first point.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imageopenpolygon-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    <dt>
<code class="parameter">image</code></dt><dd><p class="para">Ein <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span>-Objekt, das von einer der Funktionen zur Bilderzeugung, z. B.
<span class="function"><a href="function.imagecreatetruecolor.php" class="function">imagecreatetruecolor()</a></span>, zurückgegeben wurde.</p></dd>
    
     <dt><code class="parameter">points</code></dt>
     <dd>
      <p class="para">
       An array containing the polygon&#039;s vertices, e.g.:
       <table class="doctable informaltable">
        
         <tbody class="tbody">
          <tr>
           <td>points[0]</td>
           <td>= x0</td>
          </tr>

          <tr>
           <td>points[1]</td>
           <td>= y0</td>
          </tr>

          <tr>
           <td>points[2]</td>
           <td>= x1</td>
          </tr>

          <tr>
           <td>points[3]</td>
           <td>= y1</td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
    
     <dt><code class="parameter">num_points</code></dt>
     <dd>
      <p class="para">
       Total number of points (vertices), which must be at least 3.
      </p>
      <span class="simpara">
       If this parameter is omitted as per the second signature, <code class="parameter">points</code>
       must have an even number of elements, and <code class="parameter">num_points</code> is
       assumed to be <code class="code">count($points)/2</code>.
      </span>
     </dd>
    
    
     <dt><code class="parameter">color</code></dt>
     <dd>
      <p class="para">
       Eine Farbkennung, die mit <span class="function"><a href="function.imagecolorallocate.php" class="function">imagecolorallocate()</a></span> erzeugt wurde.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imageopenpolygon-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt bei Erfolg <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> zurück. Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imageopenpolygon-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.1.0</td>
      <td>
       The parameter <code class="parameter">num_points</code> has been deprecated.
      </td>
     </tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">image</code> erwartet nun eine
  <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span>-Instanz; vorher wurde eine gültige
  <code class="literal">gd</code>-<span class="type">Ressource</span> erwartet.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imageopenpolygon-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>imageopenpolygon()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Create a blank image<br /></span><span style="color: #0000BB">$image </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatetruecolor</span><span style="color: #007700">(</span><span style="color: #0000BB">400</span><span style="color: #007700">, </span><span style="color: #0000BB">300</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Allocate a color for the polygon<br /></span><span style="color: #0000BB">$col_poly </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Draw the polygon<br /></span><span style="color: #0000BB">imageopenpolygon</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">, array(<br />        </span><span style="color: #0000BB">0</span><span style="color: #007700">,   </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />        </span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">200</span><span style="color: #007700">,<br />        </span><span style="color: #0000BB">300</span><span style="color: #007700">, </span><span style="color: #0000BB">200<br />    </span><span style="color: #007700">),<br />    </span><span style="color: #0000BB">$col_poly</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Output the picture to the browser<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type: image/png'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">imagepng</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt
eine ähnliche Ausgabe wie:</p></div>
    <div class="mediaobject">
     
     <div class="imageobject">
      <img src="images/21009b70229598c6a80eef8b45bf282b-imageopenpolygon.png" alt="Output of example : imageopenpolygon()" width="400" height="300" />
     </div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imageopenpolygon-seealso">
  <h3 class="title">Siehe auch</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.imagepolygon.php" class="function" rel="rdfs-seeAlso">imagepolygon()</a> - Zeichnet ein Polygon</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>