php-doc-en/reference/image/functions/image2wbmp.xml
Máté Kocsis 593ea510e8
Generate ext/gd methodsynopses based on stubs
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-623.
2021-05-24 13:14:32 +02:00

116 lines
3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.image2wbmp" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>image2wbmp</refname>
<refpurpose>&gd.image.output;</refpurpose>
</refnamediv>
<refsynopsisdiv>
&warn.deprecated.function-7-3-0.removed-8-0-0;
</refsynopsisdiv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>image2wbmp</methodname>
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>foreground</parameter></methodparam>
</methodsynopsis>
<para>
<function>image2wbmp</function> outputs or save a <acronym>WBMP</acronym>
version of the given <parameter>image</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>image</parameter></term>
<listitem>
<para>
An image resource, returned by one of the image creation functions,
such as <function>imagecreatetruecolor</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
Path to the saved file. If not given, the raw image stream will be
output directly.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>foreground</parameter></term>
<listitem>
<para>
You can set the foreground color with this parameter by setting an
identifier obtained from <function>imagecolorallocate</function>.
The default foreground color is black.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
&gd.return.trueonerror;
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>image2wbmp</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$file = 'php.png';
$image = imagecreatefrompng($file);
header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_WBMP));
image2wbmp($image); // output the stream directly
imagedestroy($image);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>imagewbmp</function></member>
</simplelist>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->