<?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 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.imagesettile.php',
    1 => 'imagesettile',
    2 => 'Set the tile image for filling',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD and Image Functions',
  ),
  'prev' => 
  array (
    0 => 'function.imagesetthickness.php',
    1 => 'imagesetthickness',
  ),
  'next' => 
  array (
    0 => 'function.imagestring.php',
    1 => 'imagestring',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imagesettile.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagesettile" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagesettile</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagesettile</span> &mdash; <span class="dc-title">Set the tile image for filling</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagesettile-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagesettile</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="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$tile</code></span>): <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>imagesettile()</strong></span> sets the tile image to be
   used by all region filling functions (such as <span class="function"><a href="function.imagefill.php" class="function">imagefill()</a></span>
   and <span class="function"><a href="function.imagefilledpolygon.php" class="function">imagefilledpolygon()</a></span>) when filling with the special
   color <strong><code><a href="image.constants.php#constant.img-color-tiled">IMG_COLOR_TILED</a></code></strong>.
  </p>
  <p class="para">
   A tile is an image used to fill an area with a repeated pattern. <em>Any</em>
   GD image can be used as a tile, and by setting the transparent color index of the tile
   image with <span class="function"><a href="function.imagecolortransparent.php" class="function">imagecolortransparent()</a></span>, a tile allows certain parts
   of the underlying area to shine through can be created.
  </p>
  <div class="caution"><strong class="caution">Caution</strong>
   <p class="para">
    You need not take special action when you are finished with a tile, but if you
    destroy the tile image (or let PHP destroy it), you must not use the <strong><code><a href="image.constants.php#constant.img-color-tiled">IMG_COLOR_TILED</a></code></strong>
    color until you have set a new tile image!
   </p>
  </div>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagesettile-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    <dt>
<code class="parameter">image</code></dt><dd><p class="para">A <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span> object, returned by one of the image creation functions,
such as <span class="function"><a href="function.imagecreatetruecolor.php" class="function">imagecreatetruecolor()</a></span>.</p></dd>
    
     <dt><code class="parameter">tile</code></dt>
     <dd>
      <p class="para">
       The image object to be used as a tile.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagesettile-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Always returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
  </p>
 </div>


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

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">image</code> and <code class="parameter">tile</code> expect
       <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span> instances now; previously, <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>s
       were expected.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imagesettile-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>imagesettile()</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">// Load an external image<br /></span><span style="color: #0000BB">$zend </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatefromgif</span><span style="color: #007700">(</span><span style="color: #DD0000">'./zend.gif'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Create a 200x200 image<br /></span><span style="color: #0000BB">$im </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">// Set the tile<br /></span><span style="color: #0000BB">imagesettile</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">$zend</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Make the image repeat<br /></span><span style="color: #0000BB">imagefilledrectangle</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">199</span><span style="color: #007700">, </span><span style="color: #0000BB">199</span><span style="color: #007700">, </span><span style="color: #0000BB">IMG_COLOR_TILED</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Output image 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">$im</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>The above example will output
something similar to:</p></div>
    <div class="mediaobject">
     
     <div class="imageobject">
      <img src="images/21009b70229598c6a80eef8b45bf282b-imagesettile.png" alt="Output of example : imagesettile()" width="200" height="200" />
     </div>
    </div>
   </div>
  </p>
 </div>

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