mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Added documentation for imagecreatefromwbmp() and imagewbmp() functions.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@38841 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
e7db19e022
commit
1406cee9c9
1 changed files with 103 additions and 11 deletions
|
@ -811,6 +811,52 @@ function LoadPNG ($imgname) {
|
|||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.imagecreatefromwbmp">
|
||||
<refnamediv>
|
||||
<refname>ImageCreateFromWBMP</refname>
|
||||
<refpurpose>Create a new image from file or URL</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>imagecreatefromwbmp</function></funcdef>
|
||||
<paramdef>string <parameter>filename</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>ImageCreateFromWBMP</function> returns an image identifier
|
||||
representing the image obtained from the given filename.
|
||||
</para>
|
||||
<para>
|
||||
<function>ImageCreateFromWBMP</function> returns an empty string
|
||||
on failure. It also outputs an error message, which unfortunately
|
||||
displays as a broken link in a browser. To ease debugging the
|
||||
following example will produce an error <acronym>WBMP</acronym>:
|
||||
<example>
|
||||
<title>
|
||||
Example to handle an error during creation (courtesy
|
||||
vic@zymsys.com)
|
||||
</title>
|
||||
<programlisting role="php">
|
||||
function LoadWBMP ($imgname) {
|
||||
$im = @ImageCreateFromWBMP ($imgname); /* Attempt to open */
|
||||
if (!$im) { /* See if it failed */
|
||||
$im = ImageCreate (20, 20); /* Create a blank image */
|
||||
$bgc = ImageColorAllocate ($im, 255, 255, 255);
|
||||
$tc = ImageColorAllocate ($im, 0, 0, 0);
|
||||
ImageFilledRectangle ($im, 0, 0, 10, 10, $bgc);
|
||||
/* Output an errmsg */
|
||||
ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
|
||||
}
|
||||
return $im;
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.imagedashedline">
|
||||
<refnamediv>
|
||||
<refname>ImageDashedLine</refname>
|
||||
|
@ -1063,21 +1109,25 @@ function LoadPNG ($imgname) {
|
|||
portable PHP applications by auto-detecting the
|
||||
type of GD support which is available. Replace
|
||||
the sequence <literal>Header("Content-type: image/gif");
|
||||
ImageGif($im);</literal> by the more flexible sequence:
|
||||
ImageGIF($im);</literal> by the more flexible sequence:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<?php
|
||||
if (function_exists("imagegif")) {
|
||||
Header("Content-type: image/gif");
|
||||
ImageGif($im);
|
||||
ImageGIF($im);
|
||||
}
|
||||
elseif (function_exists("imagejpeg")) {
|
||||
Header("Content-type: image/jpeg");
|
||||
ImageJpeg($im, "", 0.5);
|
||||
ImageJPEG($im, "", 0.5);
|
||||
}
|
||||
elseif (function_exists("imagepng")) {
|
||||
Header("Content-type: image/png");
|
||||
ImagePng($im);
|
||||
ImagePNG($im);
|
||||
}
|
||||
elseif (function_exists("imagewbmp")) {
|
||||
Header("Content-type: image/vnd.wap.wbmp");
|
||||
ImageWBMP($im);
|
||||
}
|
||||
else
|
||||
die("No image support in this PHP server");
|
||||
|
@ -1105,8 +1155,8 @@ elseif (ImageTypes() & IMG_JPG) {
|
|||
</note>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ImagePng</function>,
|
||||
<function>ImageJpeg</function>, <function>ImageTypes</function>.
|
||||
See also <function>ImagePNG</function>, <function>ImageWBMP</function>,
|
||||
<function>ImageJPEG</function>, <function>ImageTypes</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -1130,7 +1180,7 @@ elseif (ImageTypes() & IMG_JPG) {
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
The <function>ImagePng</function> outputs a GD image stream
|
||||
The <function>ImagePNG</function> outputs a GD image stream
|
||||
(<parameter>im</parameter>) in PNG format to standard output
|
||||
(usually the browser) or, if a filename is given by the
|
||||
<parameter>filename</parameter> it outputs the image to the file.
|
||||
|
@ -1144,8 +1194,8 @@ ImagePng($im);
|
|||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ImageGif</function>,
|
||||
<function>ImageJpeg</function>, <function>ImageTypes</function>.
|
||||
See also <function>ImageGIF</function>, <function>ImageWBMP</function>,
|
||||
<function>ImageJPEG</function>, <function>ImageTypes</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -1190,8 +1240,50 @@ ImagePng($im);
|
|||
</note>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ImagePng</function>,
|
||||
<function>ImageGif</function>, <function>ImageTypes</function>.
|
||||
See also <function>ImagePNG</function>, <function>ImageGIF</function>,
|
||||
<function>ImageWBMP</function>, <function>ImageTypes</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.imagewbmp">
|
||||
<refnamediv>
|
||||
<refname>ImageWBMP</refname>
|
||||
<refpurpose>Output image to browser or file</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>imageWBMP</function></funcdef>
|
||||
<paramdef>int <parameter>im</parameter></paramdef>
|
||||
<paramdef>string
|
||||
<parameter><optional>filename</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>ImageWBMP</function> creates the
|
||||
<acronym>WBMP</acronym> file in filename from the image
|
||||
<parameter>im</parameter>. The <parameter>im</parameter> argument
|
||||
is the return from the <function>ImageCreate</function> function.
|
||||
</para>
|
||||
<para>
|
||||
The filename argument is optional, and if left off, the raw image
|
||||
stream will be output directly.
|
||||
By sending an <acronym>image/vnd.wap.wbmp</acronym> content-type
|
||||
using <function>header</function>, you can create
|
||||
a PHP script that outputs WBMP images directly.
|
||||
<note>
|
||||
<para>
|
||||
WBMP support is only available in PHP if PHP was compiled
|
||||
against GD-1.8 or later.
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ImagePNG</function, <function>ImageGIF</function>,
|
||||
<function>ImageJPEG</function>, <function>ImageTypes</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue