Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > ebb1914cf182a88528b4547490db1dd8 > files > 876

kdewebdev-quanta-doc-3.5.9-2mdv2008.1.x86_64.rpm

<HTML
><HEAD
><TITLE
>ImageCreateFromGif</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="manual.html"><LINK
REL="UP"
TITLE="Image functions"
HREF="ref.image.html"><LINK
REL="PREVIOUS"
TITLE="ImageCreate"
HREF="function.imagecreate.html"><LINK
REL="NEXT"
TITLE="ImageDashedLine"
HREF="function.imagedashedline.html"></HEAD
><BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.imagecreate.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.imagedashedline.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.imagecreatefromgif"
>ImageCreateFromGif</A
></H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN11786"
></A
>ImageCreateFromGif -- create a new image from file or URL</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN11789"
></A
><H2
>Description</H2
><DIV
CLASS="funcsynopsis"
><P
></P
><CODE
CLASS="FUNCDEF"
>int imagecreatefromgif</CODE
>(string filename);<P
></P
></DIV
><P
>&#13;     <B
CLASS="function"
>imagecreatefromgif()</B
> returns an image identifier
     representing the image obtained from the given filename.</P
><P
> 
     <B
CLASS="function"
>imagecreatefromgif()</B
> 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 GIF:
    <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><P
><B
>Example 1. Example to handle an error during creation (courtesy vic@zymsys.com )</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>  1&nbsp;
  2&nbsp;function LoadGif($imgname)
  3&nbsp;{
  4&nbsp;  $im = @imagecreatefromgif($imgname); /* Attempt to open */
  5&nbsp;  if ($im == "") { /* See if it failed */
  6&nbsp;    $im = ImageCreate(150,30); /* Create a blank image */
  7&nbsp;    $bgc = ImageColorAllocate($im,255,255,255);
  8&nbsp;    $tc  = ImageColorAllocate($im,0,0,0);
  9&nbsp;    ImageFilledRectangle($im,0,0,150,30,$bgc);
 10&nbsp;    ImageString($im,1,5,5,"Error loading $imgname",$tc); /* Output an errmsg */
 11&nbsp;  }
 12&nbsp;  return $im;
 13&nbsp;}
 14&nbsp;</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    <DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
      Since all GIF support was removed from the GD library in version 1.6,
      this function is not available if you are using that version of the
      GD library.</P
></BLOCKQUOTE
></DIV
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.imagecreate.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="manual.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.imagedashedline.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>ImageCreate</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.image.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>ImageDashedLine</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>