php-doc-en/reference/image/functions/imageantialias.xml
Daniel Egeberg 96c9d88bad Converted to utf-8
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@297028 c90b9560-bf6c-de11-be94-00142212c4b1
2010-03-28 22:10:10 +00:00

130 lines
3.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.imageantialias" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imageantialias</refname>
<refpurpose>Should antialias functions be used or not</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>imageantialias</methodname>
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
<methodparam><type>bool</type><parameter>enabled</parameter></methodparam>
</methodsynopsis>
<para>
Activate the fast drawing antialiased methods for lines and wired polygons.
It does not support alpha components. It works using a direct blend
operation. It works only with truecolor images.
</para>
<para>
Thickness and styled are not supported.
</para>
<para>
Using antialiased primitives with transparent background color can end with
some unexpected results. The blend method uses the background color as any
other colors. The lack of alpha component support does not allow an alpha
based antialiasing method.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&gd.image.description;
<varlistentry>
<term><parameter>enabled</parameter></term>
<listitem>
<para>
Whether to enable antialiasing or not.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A comparison of two lines, one with anti-aliasing switched on</title>
<programlisting role="php">
<![CDATA[
<?php
// Setup an anti-aliased image and a normal image
$aa = imagecreatetruecolor(400, 100);
$normal = imagecreatetruecolor(200, 100);
// Switch antialiasing on for one image
imageantialias($aa, true);
// Allocate colors
$red = imagecolorallocate($normal, 255, 0, 0);
$red_aa = imagecolorallocate($aa, 255, 0, 0);
// Draw two lines, one with AA enabled
imageline($normal, 0, 0, 200, 100, $red);
imageline($aa, 0, 0, 200, 100, $red_aa);
// Merge the two images side by side for output (AA: left, Normal: Right)
imagecopymerge($aa, $normal, 200, 0, 0, 0, 200, 100, 100);
// Output image
header('Content-type: image/png');
imagepng($aa);
imagedestroy($aa);
imagedestroy($normal);
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Output of example : A comparison of two lines, one with anti-aliasing switched on</alt>
<imageobject>
<imagedata fileref="en/reference/image/figures/imageantialias.png"/>
</imageobject>
</mediaobject>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.bundled.gd;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<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
-->