cvs: phpdoc /en/functions image.xml

From: Date: Sun, 07 Jan 2001 22:24:04 +0000
Subject: cvs: phpdoc /en/functions image.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969333472@lists.php.net to get a copy of this message
sniper Sun Jan 7 14:24:04 2001 EDT Modified files: /phpdoc/en/functions image.xml Log: Added documentation for imagecreatefromwbmp() and imagewbmp() functions. Index: phpdoc/en/functions/image.xml diff -u phpdoc/en/functions/image.xml:1.29 phpdoc/en/functions/image.xml:1.30 --- phpdoc/en/functions/image.xml:1.29 Sat Dec 9 20:57:27 2000 +++ phpdoc/en/functions/image.xml Sun Jan 7 14:24:04 2001 @@ -811,6 +811,52 @@ </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,22 +1109,26 @@ 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"> &lt;?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"); ?&gt; @@ -1105,8 +1155,8 @@ </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 @@ </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 @@ </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> @@ -1189,9 +1239,51 @@ </para> </note> </para> + <para> + 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>ImageTypes</function>. + See also <function>ImagePNG</function, <function>ImageGIF</function>, + <function>ImageJPEG</function>, <function>ImageTypes</function>. </para> </refsect1> </refentry>

« previous php.doc (#969333472) next »