cvs: phpdoc /en/reference/image/functions imagecreatefromgd2part.xml jpeg2wbmp.xml png2wbmp.xml
| From: | Kalle Sommer Nielsen | Date: | Sun, 24 Aug 2008 07:27:38 +0000 |
| Subject: | cvs: phpdoc /en/reference/image/functions imagecreatefromgd2part.xml jpeg2wbmp.xml png2wbmp.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2097@lists.php.net to get a copy of this message | ||
kalle Sun Aug 24 07:27:38 2008 UTC
Modified files:
/phpdoc/en/reference/image/functions imagecreatefromgd2part.xml
jpeg2wbmp.xml png2wbmp.xml
Log:
Added examples for the following functions:
* imagecreatefromgd2part()
* jpeg2wbmp()
* png2wbmp()
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/image/functions/imagecreatefromgd2part.xml?r1=1.10&r2=1.11&diff_format=u
Index: phpdoc/en/reference/image/functions/imagecreatefromgd2part.xml
diff -u phpdoc/en/reference/image/functions/imagecreatefromgd2part.xml:1.10
phpdoc/en/reference/image/functions/imagecreatefromgd2part.xml:1.11
--- phpdoc/en/reference/image/functions/imagecreatefromgd2part.xml:1.10 Tue Aug 5 07:32:04 2008
+++ phpdoc/en/reference/image/functions/imagecreatefromgd2part.xml Sun Aug 24 07:27:38 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.10 $ -->
+<!-- $Revision: 1.11 $ -->
<refentry xml:id='function.imagecreatefromgd2part' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagecreatefromgd2part</refname>
@@ -73,6 +73,38 @@
Returns an image resource identifier on success, &false; on errors.
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>imagecreatefromgd2part</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+// For this example we need the image size before
+// we create the image instance
+$image = getimagesize('./test.gd2');
+
+// Create the image instance now we got the image
+// sizes
+$im = imagecreatefromgd2part('./test.gd2', 4, 4, ($image[0] / 2) - 6, ($image[1] / 2) -
6);
+
+// Do an image operation, in this case we emboss the
+// image if PHP5+
+if(function_exists('imagefilter'))
+{
+ imagefilter($im, IMG_FILTER_EMBOSS);
+}
+
+// Save optimized image
+imagegd2($im, './test_emboss.gd2');
+imagedestroy($im);
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
<refsect1 role="notes">
&reftitle.notes;
¬e.gd.2;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/image/functions/jpeg2wbmp.xml?r1=1.9&r2=1.10&diff_format=u
Index: phpdoc/en/reference/image/functions/jpeg2wbmp.xml
diff -u phpdoc/en/reference/image/functions/jpeg2wbmp.xml:1.9
phpdoc/en/reference/image/functions/jpeg2wbmp.xml:1.10
--- phpdoc/en/reference/image/functions/jpeg2wbmp.xml:1.9 Sat Aug 23 01:03:28 2008
+++ phpdoc/en/reference/image/functions/jpeg2wbmp.xml Sun Aug 24 07:27:38 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<refentry xml:id="function.jpeg2wbmp" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>jpeg2wbmp</refname>
@@ -72,6 +72,28 @@
&return.success;
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>jpeg2wbmp</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+// Path to the target jpeg
+$path = './test.jpg';
+
+// Get the image sizes
+$image = getimagesize($path);
+
+// Convert image
+jpeg2wbmp($path, './test.wbmp', $image[1], $image[0], 5);
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
<refsect1 role="notes">
&reftitle.notes;
¬e.config.wbmp;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/image/functions/png2wbmp.xml?r1=1.9&r2=1.10&diff_format=u
Index: phpdoc/en/reference/image/functions/png2wbmp.xml
diff -u phpdoc/en/reference/image/functions/png2wbmp.xml:1.9
phpdoc/en/reference/image/functions/png2wbmp.xml:1.10
--- phpdoc/en/reference/image/functions/png2wbmp.xml:1.9 Sat Aug 23 01:03:28 2008
+++ phpdoc/en/reference/image/functions/png2wbmp.xml Sun Aug 24 07:27:38 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<refentry xml:id="function.png2wbmp" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>png2wbmp</refname>
@@ -72,6 +72,28 @@
&return.success;
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>png2wbmp</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+// Path to the target png
+$path = './test.png';
+
+// Get the image sizes
+$image = getimagesize($path);
+
+// Convert image
+png2wbmp($path, './test.wbmp', $image[1], $image[0], 7);
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
<refsect1 role="notes">
&reftitle.notes;
¬e.config.wbmp;