<?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.imagerectangle.php',
    1 => 'imagerectangle',
    2 => 'Zeichnet ein Rechteck',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD- und Image-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.imagepolygon.php',
    1 => 'imagepolygon',
  ),
  'next' => 
  array (
    0 => 'function.imageresolution.php',
    1 => 'imageresolution',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/image/functions/imagerectangle.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagerectangle" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagerectangle</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagerectangle</span> &mdash; <span class="dc-title">Zeichnet ein Rechteck</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imagerectangle-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagerectangle</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.integer.php" class="type int">int</a></span> <code class="parameter">$x1</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">$y1</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">$x2</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">$y2</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.singleton.php" class="type true">true</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imagerectangle()</strong></span> erzeugt ein Rechteck mit den angegebenen
   Koordinaten.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imagerectangle-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">x1</code></dt>
     <dd>
      <p class="para">
       Obere linke x-Koordinate.
      </p>
     </dd>
    
    
     <dt><code class="parameter">y1</code></dt>
     <dd>
      <p class="para">
       Obere linke y-Koordinate.
       0,0 ist die obere linke Ecke des Bildes.
      </p>
     </dd>
    
    
     <dt><code class="parameter">x2</code></dt>
     <dd>
      <p class="para">
       Untere rechte x-Koordinate.
      </p>
     </dd>
    
    
     <dt><code class="parameter">y2</code></dt>
     <dd>
      <p class="para">
       Untere rechte y-Koordinate.
      </p>
     </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.imagerectangle-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt immer <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> zurück.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagerectangle-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.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.imagerectangle-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 Einfaches <span class="function"><strong>imagerectangle()</strong></span>-Beispiel</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">// Erzeuge ein 200x200-Bild<br /></span><span style="color: #0000BB">$canvas </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatetruecolor</span><span style="color: #007700">(</span><span style="color: #0000BB">200</span><span style="color: #007700">, </span><span style="color: #0000BB">200</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Alloziere Farben<br /></span><span style="color: #0000BB">$pink </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$canvas</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">105</span><span style="color: #007700">, </span><span style="color: #0000BB">180</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$white </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$canvas</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 /></span><span style="color: #0000BB">$green </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$canvas</span><span style="color: #007700">, </span><span style="color: #0000BB">132</span><span style="color: #007700">, </span><span style="color: #0000BB">135</span><span style="color: #007700">, </span><span style="color: #0000BB">28</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Zeichne drei Rechtecke mit unterschiedlicher Farbe<br /></span><span style="color: #0000BB">imagerectangle</span><span style="color: #007700">(</span><span style="color: #0000BB">$canvas</span><span style="color: #007700">, </span><span style="color: #0000BB">50</span><span style="color: #007700">, </span><span style="color: #0000BB">50</span><span style="color: #007700">, </span><span style="color: #0000BB">150</span><span style="color: #007700">, </span><span style="color: #0000BB">150</span><span style="color: #007700">, </span><span style="color: #0000BB">$pink</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagerectangle</span><span style="color: #007700">(</span><span style="color: #0000BB">$canvas</span><span style="color: #007700">, </span><span style="color: #0000BB">45</span><span style="color: #007700">, </span><span style="color: #0000BB">60</span><span style="color: #007700">, </span><span style="color: #0000BB">120</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">$white</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagerectangle</span><span style="color: #007700">(</span><span style="color: #0000BB">$canvas</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">120</span><span style="color: #007700">, </span><span style="color: #0000BB">75</span><span style="color: #007700">, </span><span style="color: #0000BB">160</span><span style="color: #007700">, </span><span style="color: #0000BB">$green</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Ausgabe<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Type: image/jpeg'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagejpeg</span><span style="color: #007700">(</span><span style="color: #0000BB">$canvas</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-imagerectangle.jpg" alt="Ausgabe des Beispiels: Einfaches imagerectangle()-Beispiel" width="200" height="200" />
     </div>
    </div>
   </div>
  </p>
 </div>


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