Files
doc-fr/reference/image/functions/imagecreatefromstring.xml
Yannick Torres 87298a989f sync with EN revision
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@166250 c90b9560-bf6c-de11-be94-00142212c4b1
2004-08-13 08:59:17 +00:00

90 lines
2.6 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
<!-- Reviewed: yes -->
<refentry id="function.imagecreatefromstring">
<refnamediv>
<refname>imagecreatefromstring</refname>
<refpurpose>Crée une image à partir d'une chaîne</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>imagecreatefromstring</methodname>
<methodparam><type>string</type><parameter>image</parameter></methodparam>
</methodsynopsis>
<para>
<function>imagecreatefromstring</function> retourne un identifiant d'image
représentant l'image obtenu depuis la chaîne <parameter>image</parameter>.
Le type de l'image sera automatiquement détecté si vous avez compilé &php; avec les supports :
JPEG, PNG, GIF, WBMP et GD2.
</para>
</refsect1>
<refsect1>
&reftitle.returnvalues;
<para>
Une ressource d'image sera retourné en cas de succès. &false; est retourné si
le type de l'image n'est pas supporté, si les données ne sont pas dans un format reconnu
ou si l'image est corrompue et donc ne peut être chargée.
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>imagecreatefromjpeg</function>,
<function>imagecreatefrompng</function>,
<function>imagecreatefromgif</function>&listendand;
<function>imagecreate</function>.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<para>
<example>
<title>Exemple avec <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);
}
else {
echo 'Une erreur est survenue.';
}
?>
]]>
</programlisting>
</example>
</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:"../../../../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
-->