Added examples for the following functions:

* imagecreatefromgd2part()
 * jpeg2wbmp()
 * png2wbmp()


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@265411 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kalle Sommer Nielsen 2008-08-24 07:27:38 +00:00
parent 20a326f84d
commit a4345870c0
3 changed files with 79 additions and 3 deletions

View file

@ -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;
&note.gd.2;

View file

@ -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;
&note.config.wbmp;

View file

@ -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;
&note.config.wbmp;