Add image example output

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@227604 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Hannes Magnusson 2007-01-19 19:49:07 +00:00
parent f0884026ba
commit bc9bd08ff7
44 changed files with 144 additions and 30 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<refentry id="function.imagearc">
<refnamediv>
<refname>imagearc</refname>
@ -110,10 +110,17 @@ $img = imagecreatetruecolor(200, 200);
// allocate some colors
$white = imagecolorallocate($img, 255, 255, 255);
$black = imagecolorallocate($img, 0, 0, 0);
$red = imagecolorallocate($img, 255, 0, 0);
$green = imagecolorallocate($img, 0, 255, 0);
$blue = imagecolorallocate($img, 0, 0, 255);
// draw a black circle
imagearc($img, 100, 100, 150, 150, 0, 360, $black);
// draw the head
imagearc($img, 100, 100, 200, 200, 0, 360, $white);
// mouth
imagearc($img, 100, 100, 150, 150, 25, 155, $red);
// left and then the right eye
imagearc($img, 60, 75, 50, 50, 0, 360, $green);
imagearc($img, 140, 75, 50, 50, 0, 360, $blue);
// output image in the browser
header("Content-type: image/png");
@ -125,6 +132,10 @@ imagedestroy($img);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagearc.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.imagechar">
<refnamediv>
<refname>imagechar</refname>
@ -97,6 +97,10 @@ imagepng($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagechar.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<refentry id="function.imagecharup">
<refnamediv>
<refname>imagecharup</refname>
@ -94,6 +94,10 @@ imagepng($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecharup.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.imagecolorallocatealpha">
<refnamediv>
<refname>imagecolorallocatealpha</refname>
@ -115,6 +115,10 @@ imagedestroy($image);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecolorallocatealpha.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.imagecolorat">
<refnamediv>
<refname>imagecolorat</refname>
@ -62,14 +62,22 @@
<programlisting role="php">
<![CDATA[
<?php
$im = ImageCreateFromPng("rockym.png");
$rgb = ImageColorAt($im, 100, 100);
$im = imagecreatefrompng("php.png");
$rgb = imagecolorat($im, 10, 15);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
int(119)
int(123)
int(180)
]]>
</screen>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.imagecopyresampled">
<refnamediv>
<refname>imagecopyresampled</refname>
@ -162,6 +162,10 @@ imagejpeg($image_p, null, 100);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecopyresampled.jpg" />
</screenshot>
</example>
</para>
<para>
@ -205,6 +209,10 @@ imagejpeg($image_p, null, 100);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecopyresampled_2.jpg" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.imagecopyresized">
<refnamediv>
<refname>imagecopyresized</refname>
@ -162,6 +162,10 @@ imagejpeg($thumb);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecopyresized.jpg" />
</screenshot>
<para>
The image will be output at half size, though better
quality could be obtained using <function>imagecopyresampled</function>.

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<refentry id="function.imagecreate">
<refnamediv>
<refname>imagecreate</refname>
@ -60,9 +60,9 @@
<![CDATA[
<?php
header("Content-type: image/png");
$im = @imagecreate(100, 50)
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
@ -70,6 +70,10 @@ imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecreate.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<!-- $Revision: 1.16 $ -->
<refentry id="function.imagecreatefromgif">
<refnamediv>
<refname>imagecreatefromgif</refname>
@ -35,9 +35,16 @@ function LoadGif ($imgname)
}
return $im;
}
header("Content-Type: image/gif");
$img = LoadGif("bogus.image");
imagegif($img);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecreatefromgif.gif" />
</screenshot>
</example>
</para>
&tip.fopen-wrapper;

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<!-- $Revision: 1.16 $ -->
<refentry id="function.imagecreatefromjpeg">
<refnamediv>
<refname>imagecreatefromjpeg</refname>
@ -38,9 +38,16 @@ function LoadJpeg($imgname)
}
return $im;
}
header("Content-Type: image/jpeg");
$img = LoadJpeg("bogus.image");
imagejpeg($img);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecreatefromjpeg.jpg" />
</screenshot>
</example>
</para>
&tip.fopen-wrapper;

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.imagecreatefrompng">
<refnamediv>
<refname>imagecreatefrompng</refname>
@ -38,9 +38,16 @@ function LoadPNG($imgname)
}
return $im;
}
header("Content-Type: image/png");
$img = LoadPNG("bogus.image");
imagepng($img);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecreatefrompng.png" />
</screenshot>
</example>
</para>
&tip.fopen-wrapper;

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<refentry id="function.imagecreatefromstring">
<refnamediv>
<refname>imagecreatefromstring</refname>
@ -66,6 +66,10 @@ else {
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecreatefromstring.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.imagecreatetruecolor">
<refnamediv>
<refname>imagecreatetruecolor</refname>
@ -65,7 +65,7 @@
<![CDATA[
<?php
header ("Content-type: image/png");
$im = @imagecreatetruecolor(50, 100)
$im = @imagecreatetruecolor(120, 20)
or die("Cannot Initialize new GD image stream");
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
@ -74,6 +74,10 @@ imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagecreatetruecolor.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<refentry id="function.imageellipse">
<refnamediv>
<refname>imageellipse</refname>
@ -103,6 +103,10 @@ imagepng($image);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imageellipse.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.imagefill">
<refnamediv>
<refname>imagefill</refname>
@ -80,6 +80,10 @@ imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagefill.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<refentry id="function.imagefilledarc">
<refnamediv>
<refname>imagefilledarc</refname>
@ -160,6 +160,10 @@ imagedestroy($image);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagefilledarc.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.14 $ -->
<!-- $Revision: 1.15 $ -->
<refentry id="function.imagefilledellipse">
<refnamediv>
<refname>imagefilledellipse</refname>
@ -104,6 +104,10 @@ imagepng($image);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagefilledellipse.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<refentry id="function.imagefilledpolygon">
<refnamediv>
<refname>imagefilledpolygon</refname>
@ -94,6 +94,10 @@ imagedestroy($image);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagefilledpolygon.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.imagepolygon">
<refnamediv>
<refname>imagepolygon</refname>
@ -92,6 +92,10 @@ imagepng($image);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagepolygon.png" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<refentry id="function.imagerotate">
<refnamediv>
<refname>imagerotate</refname>
@ -103,6 +103,7 @@
</para>
<programlisting role="php">
<![CDATA[
<?php
// File and rotation
$filename = 'test.jpg';
$degrees = 180;
@ -118,8 +119,13 @@ $rotate = imagerotate($source, $degrees, 0);
// Output
imagejpeg($rotate);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagerotate.jpg" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<refentry id="function.imagesetstyle">
<refnamediv>
<refname>imagesetstyle</refname>
@ -77,6 +77,10 @@ imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagesetstyle.jpg" />
</screenshot>
</example>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- $Revision: 1.14 $ -->
<refentry id="function.imagestring">
<refnamediv>
<refname>imagestring</refname>
@ -92,6 +92,10 @@ imagepng($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<screenshot>
<graphic fileref="figures/image.imagestring.png" />
</screenshot>
</example>
</para>
</refsect1>