mirror of
https://github.com/php/doc-es.git
synced 2026-04-24 07:38:19 +02:00
a85d394330
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@336392 c90b9560-bf6c-de11-be94-00142212c4b1
126 lines
3.2 KiB
XML
126 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: fbc4ef92fa953823ed73021e462bd291499dc633 Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="function.imagecreatefromgif" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>imagecreatefromgif</refname>
|
|
<refpurpose>&gd.image.new;</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>imagecreatefromgif</methodname>
|
|
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>imagecreatefromgif</function> devuelve un identificador de imagen
|
|
que representa la imagen obtenida desde el nombre de fichero dado.
|
|
</para>
|
|
&tip.fopen-wrapper;
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>filename</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Ruta de la imagen GIF.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>&gd.return.identifier;</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Ejemplo de manejar un error durante la carga de un GIF</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
function CargarGif($imagen)
|
|
{
|
|
/* Intentar abrir */
|
|
$im = @imagecreatefromgif($imagen);
|
|
|
|
/* Ver si falló */
|
|
if(!$im)
|
|
{
|
|
/* Crear una imagen en blanco */
|
|
$im = imagecreatetruecolor (150, 30);
|
|
$fondo = imagecolorallocate ($im, 255, 255, 255);
|
|
$ct = imagecolorallocate ($im, 0, 0, 0);
|
|
|
|
imagefilledrectangle ($im, 0, 0, 150, 30, $fondo);
|
|
|
|
/* Imprimir un mensaje de error */
|
|
imagestring ($im, 1, 5, 5, 'Error cargando ' . $imagen, $ct);
|
|
}
|
|
|
|
return $im;
|
|
}
|
|
|
|
header('Content-Type: image/gif');
|
|
|
|
$img = CargarGif('falso.image');
|
|
|
|
imagegif($img);
|
|
imagedestroy($img);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<mediaobject>
|
|
<alt>Salida del ejemplo : Ejemplo de manejar un error durante la carga de un GIF</alt>
|
|
<imageobject>
|
|
<imagedata fileref="en/reference/image/figures/imagecreatefromgif.gif"/>
|
|
</imageobject>
|
|
</mediaobject>
|
|
</example>
|
|
</refsect1>
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
El soporte para GIF se eliminó de la biblioteca GD en la Versión 1.6,
|
|
y se volvió a añdir en la Versión 2.0.28. Esta función no está
|
|
disponible entre estas versiones.
|
|
</para>
|
|
</note>
|
|
<note>
|
|
<para>
|
|
Al leer ficheros GIF animados desde memoria, solamente es devuelto el
|
|
primer fotograma de la imagen al puntero de recurso.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|