<!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>Convert PNG image file to WBMP image file</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.jpeg2wbmp.html">jpeg2wbmp</a></div> <div class="next" style="text-align: right; float: right;"><a href="book.gmagick.html">Gmagick</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.png2wbmp" class="refentry"> <div class="refnamediv"> <h1 class="refname">png2wbmp</h1> <p class="verinfo">(PHP 4 >= 4.0.5, PHP 5)</p><p class="refpurpose"><span class="refname">png2wbmp</span> — <span class="dc-title">Convert PNG image file to WBMP image file</span></p> </div> <div class="refsect1 description" id="refsect1-function.png2wbmp-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>png2wbmp</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$pngname</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$wbmpname</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$dest_height</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$dest_width</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$threshold</code></span> )</div> <p class="para rdfs-comment"> Converts a PNG file into a WBMP file. </p> </div> <div class="refsect1 parameters" id="refsect1-function.png2wbmp-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">pngname</code></em></span> <dd> <p class="para"> Path to PNG file. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">wbmpname</code></em></span> <dd> <p class="para"> Path to destination WBMP file. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">dest_height</code></em></span> <dd> <p class="para"> Destination image height. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">dest_width</code></em></span> <dd> <p class="para"> Destination image width. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">threshold</code></em></span> <dd> <p class="para"> Threshold value, between 0 and 8 (inclusive). </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.png2wbmp-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> <div class="refsect1 examples" id="refsect1-function.png2wbmp-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-3297"> <p><strong>Example #1 <span class="function"><strong>png2wbmp()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// Path to the target png<br /></span><span style="color: #0000BB">$path </span><span style="color: #007700">= </span><span style="color: #DD0000">'./test.png'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Get the image sizes<br /></span><span style="color: #0000BB">$image </span><span style="color: #007700">= </span><span style="color: #0000BB">getimagesize</span><span style="color: #007700">(</span><span style="color: #0000BB">$path</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Convert image<br /></span><span style="color: #0000BB">png2wbmp</span><span style="color: #007700">(</span><span style="color: #0000BB">$path</span><span style="color: #007700">, </span><span style="color: #DD0000">'./test.wbmp'</span><span style="color: #007700">, </span><span style="color: #0000BB">$image</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">], </span><span style="color: #0000BB">$image</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">], </span><span style="color: #0000BB">7</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 notes" id="refsect1-function.png2wbmp-notes"> <h3 class="title">Notes</h3> <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">WBMP support is only available if PHP was compiled against GD-1.8 or later.</span></p></blockquote> </div> <div class="refsect1 seealso" id="refsect1-function.png2wbmp-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.jpeg2wbmp.html" class="function" rel="rdfs-seeAlso">jpeg2wbmp()</a> - Convert JPEG image file to WBMP image 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.jpeg2wbmp.html">jpeg2wbmp</a></div> <div class="next" style="text-align: right; float: right;"><a href="book.gmagick.html">Gmagick</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>