mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 16:32:13 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@324762 c90b9560-bf6c-de11-be94-00142212c4b1
114 lines
3.3 KiB
XML
114 lines
3.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 5de0ed09203c4982a40e6468870fba9090f5a55e Maintainer: seros Status: ready -->
|
|
<refentry xml:id="function.imagecreatefromstring" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>imagecreatefromstring</refname>
|
|
<refpurpose>Crear una imagen nueva desde el flujo de imagen de la cadena</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>imagecreatefromstring</methodname>
|
|
<methodparam><type>string</type><parameter>image</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>imagecreatefromstring</function> devuelve un identificador de imagen
|
|
que representa la imagen obtenida desde <parameter>image</parameter>.
|
|
Estos tipos serán automáticamente detectados si se construye PHP para que los
|
|
soporte: JPEG, PNG, GIF, WBMP y GD2.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>image</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Una cadena que contiene la información de la imagen.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Será devuelto un recurso de imagen. Se devuelve &false; si
|
|
el tipo de imagen no está soportado, la información no está en un formato reconocido,
|
|
o la imagen está corrupta y no se puede cargar.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>imagecreatefromstring</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$data = 'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl'
|
|
. 'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr'
|
|
. 'EX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r'
|
|
. '8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==';
|
|
$data = base64_decode($data);
|
|
|
|
$im = imagecreatefromstring($data);
|
|
if ($im !== false) {
|
|
header('Content-Type: image/png');
|
|
imagepng($im);
|
|
imagedestroy($im);
|
|
}
|
|
else {
|
|
echo 'Ocurrió un error.';
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<mediaobject>
|
|
<alt>Salida del ejemplo : imagecreatefromstring()</alt>
|
|
<imageobject>
|
|
<imagedata fileref="en/reference/image/figures/imagecreatefromstring.png"/>
|
|
</imageobject>
|
|
</mediaobject>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>imagecreatefromjpeg</function></member>
|
|
<member><function>imagecreatefrompng</function></member>
|
|
<member><function>imagecreatefromgif</function></member>
|
|
<member><function>imagecreatetruecolor</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</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
|
|
-->
|