mirror of
https://github.com/php/doc-es.git
synced 2026-03-23 23:12:09 +01:00
156 lines
3.9 KiB
XML
156 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 55f2d0cda1972031881f6e3464946144dfb900a2 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.imagegd" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>imagegd</refname>
|
|
<refpurpose>Genera una imagen en formato GD, hacia el navegador o un fichero</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>imagegd</methodname>
|
|
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>file</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Genera o guarda el fichero <parameter>file</parameter> en formato GD.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&gd.image.description;
|
|
<varlistentry>
|
|
<term><parameter>file</parameter></term>
|
|
<listitem>
|
|
<para>&gd.image.path;</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
&gd.return.trueonerror;
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.3</entry>
|
|
<entry>
|
|
<parameter>file</parameter> ahora es nullable.
|
|
</entry>
|
|
</row>
|
|
&gd.changelog.image-param;
|
|
<row>
|
|
<entry>7.2.0</entry>
|
|
<entry>
|
|
<function>imagegd</function> ahora permite producir imágenes
|
|
TrueColor. Anteriormente, eran convertidas implícitamente a paleta.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Mostrar una imagen GD</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Creación de una imagen vacía y adición de texto
|
|
$im = imagecreatetruecolor(120, 20);
|
|
$text_color = imagecolorallocate($im, 233, 14, 91);
|
|
imagestring($im, 1, 5, 5, "Un texto simple", $text_color);
|
|
|
|
// Mostrar la imagen
|
|
imagegd($im);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Guardar una imagen GD</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Creación de una imagen vacía y adición de texto
|
|
$im = imagecreatetruecolor(120, 20);
|
|
$text_color = imagecolorallocate($im, 233, 14, 91);
|
|
imagestring($im, 1, 5, 5, "Un texto simple", $text_color);
|
|
|
|
// Guardar la imagen GD
|
|
// El formato de fichero para imágenes GD es .gd, ver http://www.libgd.org/GdFileFormats
|
|
imagegd($im, 'simple.gd');
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
El formato GD se utiliza comúnmente para permitir la carga rápida
|
|
de partes de una imagen. Tenga en cuenta que el formato GD solo
|
|
es utilizable en aplicaciones compatibles con GD.
|
|
</para>
|
|
</note>
|
|
&gd.deprecated.gd-formats;
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>imagegd2</function></member>
|
|
</simplelist>
|
|
</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
|
|
-->
|