<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.imagebmp.php',
    1 => 'imagebmp',
    2 => 'Affiche ou enregistre une image BMP au navigateur ou dans un fichier',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'Fonctions GD et images',
  ),
  'prev' => 
  array (
    0 => 'function.imageavif.php',
    1 => 'imageavif',
  ),
  'next' => 
  array (
    0 => 'function.imagechar.php',
    1 => 'imagechar',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/image/functions/imagebmp.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagebmp" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagebmp</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.2.0, PHP 8)</p><p class="refpurpose"><span class="refname">imagebmp</span> &mdash; <span class="dc-title">Affiche ou enregistre une image BMP au navigateur ou dans un fichier</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imagebmp-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagebmp</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.resource.php" class="type resource">resource</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span> <code class="parameter">$file</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$compressed</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.true">true</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">
   Affiche ou enregistre une version BMP de l&#039;<code class="parameter">image</code> fournie.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imagebmp-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
<dt><code class="parameter">image</code></dt><dd><p class="para">
 Un objet <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span>, retournée par une des fonctions de
 création d&#039;images, comme <span class="function"><a href="function.imagecreatetruecolor.php" class="function">imagecreatetruecolor()</a></span>.
</p></dd>
    
     <dt><code class="parameter">file</code></dt>
     <dd>
      <p class="para">Le chemin ou un flux de ressource ouvert (qui sera automatiquement fermé après
        le retour de cette fonction) vers lequel le fichier sera sauvegardé.
        Si non-défini ou <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, le flux brute de l&#039;image sera affiché directement.</p>
      <blockquote class="note"><p><strong class="note">Note</strong>: 
       <p class="para">
        <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> est invalide si l&#039;argument <code class="parameter">compressed</code> est
        inutilisé.
       </p>
      </p></blockquote>
     </dd>
    
    
     <dt><code class="parameter">compressed</code></dt>
     <dd>
      <p class="para">
       Si le BMP doit être compressé avec <code class="literal">run-length encoding</code> (RLE), ou pas.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imagebmp-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
  <div class="caution"><strong class="caution">Attention</strong><p class="simpara">Toutefois, si libgd ne parvient pas à produire l&#039;image, cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.</p></div>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagebmp-changelog">
  <h3 class="title">Historique</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> attend une instance de <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span> désormais;
  auparavant, une <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="literal">gd</code> était attendue.
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       Le type de <code class="parameter">compressed</code> est désormais <a href="language.types.boolean.php" class="link">booléen</a> ;
       auparavant c&#039;était <a href="language.types.integer.php" class="link">entier</a>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>



 <div class="refsect1 examples" id="refsect1-function.imagebmp-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Enregistrer un fichier BMP</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">// Créer une image vierge et ajouter du texte<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 /><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">'BMP with PHP'</span><span style="color: #007700">, </span><span style="color: #0000BB">$text_color</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Enregistre l'image<br /></span><span style="color: #0000BB">imagebmp</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #DD0000">'php.bmp'</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); ?>