Files
doc-fr/reference/image/functions/imagecolorresolvealpha.xml
2021-09-24 04:13:47 +01:00

156 lines
4.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: yannick Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.imagecolorresolvealpha" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagecolorresolvealpha</refname>
<refpurpose>
Retourne un index de couleur ou son alternative la plus proche,
y compris le canal alpha
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>imagecolorresolvealpha</methodname>
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
<methodparam><type>int</type><parameter>red</parameter></methodparam>
<methodparam><type>int</type><parameter>green</parameter></methodparam>
<methodparam><type>int</type><parameter>blue</parameter></methodparam>
<methodparam><type>int</type><parameter>alpha</parameter></methodparam>
</methodsynopsis>
<para>
<function>imagecolorresolvealpha</function> retourne toujours
un index de couleur, disponible dans la palette
de l'image <parameter>image</parameter> : soit c'est la couleur
exacte, soit c'est la meilleure approximation.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&gd.image.description;
<varlistentry>
<term><parameter>red</parameter></term>
<listitem>
<para>&gd.value.red;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>green</parameter></term>
<listitem>
<para>&gd.value.green;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>blue</parameter></term>
<listitem>
<para>&gd.value.blue;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>alpha</parameter></term>
<listitem>
<para>
Une valeur comprise entre <literal>0</literal> et <literal>127</literal>.
<literal>0</literal> indique une opacité complète tandis que
<literal>127</literal> indique une transparence complète.
</para>
</listitem>
</varlistentry>
</variablelist>
Les paramètres sur les couleurs sont des entiers entre 0 et 255 ou
des hexadécimaux compris entre 0x00 et 0xFF.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Retourne un index de couleur.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&gd.changelog.image-param;
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Exemple avec <function>imagecoloresolve</function>
pour récupérer les couleurs d'une image</title>
<programlisting role="php">
<![CDATA[
<?php
// Chargement de l'image
$im = imagecreatefromgif('phplogo.gif');
// Récupération des couleurs les plus proches de l'image
$colors = array();
$colors[] = imagecolorresolvealpha($im, 255, 255, 255, 0);
$colors[] = imagecolorresolvealpha($im, 0, 0, 200, 127);
// Affichage
print_r($colors);
imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Array
(
[0] => 89
[1] => 85
)
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>imagecolorclosestalpha</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
-->