<?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.imagexbm.php',
    1 => 'imagexbm',
    2 => 'Output an XBM image to browser or file',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD- und Image-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.imagewebp.php',
    1 => 'imagewebp',
  ),
  'next' => 
  array (
    0 => 'function.iptcembed.php',
    1 => 'iptcembed',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imagexbm.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagexbm" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagexbm</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagexbm</span> &mdash; <span class="dc-title">Output an XBM image to browser or file</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagexbm-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagexbm</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"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$filename</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$foreground_color</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Outputs or save an <abbr title="X Bitmap">XBM</abbr> version of the given 
   <code class="parameter">image</code>. 
  </p>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <span class="simpara">
    <span class="function"><strong>imagexbm()</strong></span> doesn&#039;t apply any padding, so the image width
    has to be a multiple of 8.
    This restriction does no longer apply as of PHP 7.0.9.
   </span>
  </p></blockquote>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagexbm-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">filename</code></dt>
     <dd>
      <p class="para">The path to save the file to, given as <a href="language.types.string.php" class="link">String</a>. If <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, the raw image stream will be output directly.</p>
      <p class="para">
       The <code class="parameter">filename</code> (without the .xbm extension) is also
       used for the C identifiers of the <abbr title="X Bitmap">XBM</abbr>, whereby non
       alphanumeric characters of the current locale are substituted by
       underscores. If <code class="parameter">filename</code> is set to <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>,
       <code class="literal">image</code> is used to build the C identifiers.
      </p>
     </dd>
    
    
     <dt><code class="parameter">foreground_color</code></dt>
     <dd>
      <p class="para">
       You can set the foreground color with this parameter by setting an
       identifier obtained from <span class="function"><a href="function.imagecolorallocate.php" class="function">imagecolorallocate()</a></span>.
       The default foreground color is black. All other colors are treated as
       background.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagexbm-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 class="caution"><strong class="caution">Achtung</strong><p class="simpara">Wenn libgd das Bild nicht ausgeben kann, gibt diese Funktion <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> zurück.</p></div>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagexbm-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>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">foreground_color</code> is now nullable.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       The fourth parameter, which was unused, has been removed.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imagexbm-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 Saving an XBM file</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 and add some text<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">120</span><span style="color: #007700">, </span><span style="color: #0000BB">20</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$text_color </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">233</span><span style="color: #007700">, </span><span style="color: #0000BB">14</span><span style="color: #007700">, </span><span style="color: #0000BB">91</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagestring</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">5</span><span style="color: #007700">, </span><span style="color: #0000BB">5</span><span style="color: #007700">,  </span><span style="color: #DD0000">'A Simple Text String'</span><span style="color: #007700">, </span><span style="color: #0000BB">$text_color</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Save the image<br /></span><span style="color: #0000BB">imagexbm</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #DD0000">'simpletext.xbm'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Beispiel #2 Saving an XBM file with a different foreground color</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 and add some text<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">120</span><span style="color: #007700">, </span><span style="color: #0000BB">20</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$text_color </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">233</span><span style="color: #007700">, </span><span style="color: #0000BB">14</span><span style="color: #007700">, </span><span style="color: #0000BB">91</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagestring</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">5</span><span style="color: #007700">, </span><span style="color: #0000BB">5</span><span style="color: #007700">,  </span><span style="color: #DD0000">'A Simple Text String'</span><span style="color: #007700">, </span><span style="color: #0000BB">$text_color</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Set a replacement foreground color<br /></span><span style="color: #0000BB">$foreground_color </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">255</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">);<br /><br /></span><span style="color: #FF8000">// Save the image<br /></span><span style="color: #0000BB">imagexbm</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">NULL</span><span style="color: #007700">, </span><span style="color: #0000BB">$foreground_color</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


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