[PHP-DOC] cvs: phpdoc /en/functions image.xml From: Sterling Hughes (stirling <email protected>)
Date: 07/17/00

sterling Mon Jul 17 15:10:48 2000 EDT

  Modified files:
    /phpdoc/en/functions image.xml
  Log:
  -Small Changes to the examples
  -Addition of an example for ImageCreate.
  
  
  
Index: phpdoc/en/functions/image.xml
diff -u phpdoc/en/functions/image.xml:1.14 phpdoc/en/functions/image.xml:1.15
--- phpdoc/en/functions/image.xml:1.14 Fri Jul 14 19:53:57 2000
+++ phpdoc/en/functions/image.xml Mon Jul 17 15:10:48 2000
@@ -622,13 +622,29 @@
      <function>ImageCreate</function> returns an image identifier
      representing a blank image of size <parameter>x_size</parameter>
      by <parameter>y_size</parameter>.
+ <example>
+ <title>
+ Creating a new GD image stream and outputting an image.
+ </title>
+ <programlisting role="php">
+&lt;?
+header ("Content-type: image/png");
+$im =  <email protected> (50, 100)
+ or die ("Cannot Initialize new GD image stream");
+$background_color = ImageColorAllocate ($im, 255, 255, 255);
+$text_color = ImageColorAllocate ($im, 233, 14, 91);
+ImageString ($im, 1, 5, 5, "A Simple Text String", $text_color);
+ImagePng ($im);
+?>
+ </programlisting>
+ </example>
     </para>
    </refsect1>
   </refentry>
 
   <refentry id="function.imagecreatefromgif">
    <refnamediv>
- <refname>ImageCreateFromGif</refname>
+ <refname>ImageCreateFromGIF</refname>
     <refpurpose>Create a new image from file or URL</refpurpose>
    </refnamediv>
    <refsect1>
@@ -655,8 +671,8 @@
      </title>
       <programlisting role="php">
 function LoadGif ($imgname) {
- $im =  <email protected> ($imgname); /* Attempt to open */
- if ($im == "") { /* See if it failed */
+ $im =  <email protected> ($imgname); /* Attempt to open */
+ if (!$im) { /* See if it failed */
         $im = ImageCreate (150, 30); /* Create a blank image */
         $bgc = ImageColorAllocate ($im, 255, 255, 255);
         $tc = ImageColorAllocate ($im, 0, 0, 0);
@@ -708,8 +724,8 @@
       </title>
       <programlisting role="php">
 function LoadJpeg ($imgname) {
- $im =  <email protected> ($imgname); /* Attempt to open */
- if ($im == "") { /* See if it failed */
+ $im =  <email protected> ($imgname); /* Attempt to open */
+ if (!$im) { /* See if it failed */
         $im = ImageCreate (150, 30); /* Create a blank image */
         $bgc = ImageColorAllocate ($im, 255, 255, 255);
         $tc = ImageColorAllocate ($im, 0, 0, 0);
@@ -754,8 +770,8 @@
       </title>
       <programlisting role="php">
 function LoadPNG ($imgname) {
- $im =  <email protected> ($imgname); /* Attempt to open */
- if ($im == "") { /* See if it failed */
+ $im =  <email protected> ($imgname); /* Attempt to open */
+ if (!$im) { /* See if it failed */
         $im = ImageCreate (150, 30); /* Create a blank image */
         $bgc = ImageColorAllocate ($im, 255, 255, 255);
         $tc = ImageColorAllocate ($im, 0, 0, 0);
@@ -1025,7 +1041,7 @@
 
   <refentry id="function.imagepng">
     <refnamediv>
- <refname>ImagePng</refname>
+ <refname>ImagePNG</refname>
       <refpurpose>
         Output a PNG image to either the browser or a file
       </refpurpose>
@@ -1047,8 +1063,10 @@
         <parameter>filename</parameter> it outputs the image to the file.
         <informalexample>
           <programlisting role="php">
+&lt;?
 $im = ImageCreateFromPng("test.png");
 ImagePng($im);
+?>
           </programlisting>
         </informalexample>
       </para>