Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 4069

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Output image to browser or file</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.image-type-to-mime-type.html">image_type_to_mime_type</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imageaffine.html">imageaffine</a></div>
 <div class="up"><a href="ref.image.html">GD and Image Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.image2wbmp" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">image2wbmp</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">image2wbmp</span> &mdash; <span class="dc-title">Output image to browser or file</span></p>

 </div>

 <div id="function.image2wbmp-refsynopsisdiv">
  <div class="warning"><strong class="warning">Warning</strong>
   <p class="para">
    <span class="function"><strong>image2wbmp()</strong></span> is deprecated as of PHP 7.3.0, and will be
    removed in the next major version. Use <span class="function"><a href="function.imagewbmp.html" class="function">imagewbmp()</a></span>
    instead.
   </p>
  </div>
 </div>

 <div class="refsect1 description" id="refsect1-function.image2wbmp-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>image2wbmp</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$image</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$foreground</code></span>
  ]] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>image2wbmp()</strong></span> outputs or save a <acronym title="Wireless Bitmap">WBMP</acronym>
   version of the given <code class="parameter">image</code>. 
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.image2wbmp-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>
<code class="parameter">
image</code></dt>
<dd>
<p class="para">An image resource, returned by one of the image creation functions,
such as <span class="function"><a href="function.imagecreatetruecolor.html" class="function">imagecreatetruecolor()</a></span>.</p></dd>

    
     <dt>
<code class="parameter">filename</code></dt>

     <dd>

      <p class="para">
       Path to the saved file. If not given, the raw image stream will be
       output directly.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">foreground</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.html" class="function">imagecolorallocate()</a></span>.
       The default foreground color is black.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.image2wbmp-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
  <div class="caution"><strong class="caution">Caution</strong><p class="simpara">However, if libgd fails to output the image, this function returns <strong><code>TRUE</code></strong>.</p></div>
 </div>

 <div class="refsect1 examples" id="refsect1-function.image2wbmp-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3737">
    <p><strong>Example #1 <span class="function"><strong>image2wbmp()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$file&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'php.png'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$image&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecreatefrompng</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Type:&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">image_type_to_mime_type</span><span style="color: #007700">(</span><span style="color: #0000BB">IMAGETYPE_WBMP</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">image2wbmp</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;output&nbsp;the&nbsp;stream&nbsp;directly<br /></span><span style="color: #0000BB">imagedestroy</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>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.image2wbmp-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.imagewbmp.html" class="function" rel="rdfs-seeAlso">imagewbmp()</a> - Output image to browser or file</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.image-type-to-mime-type.html">image_type_to_mime_type</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imageaffine.html">imageaffine</a></div>
 <div class="up"><a href="ref.image.html">GD and Image Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>