php-doc-en/reference/image/functions/imageistruecolor.xml
Kalle Sommer Nielsen baa9dab8ca * Fixes #43529 (readdir(), rewinddir() and closedir() don't always fail when passed 0 arguments)
* Fixed wrong call in example on imageinterlace()
* Added example for imageistruecolor()


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@264477 c90b9560-bf6c-de11-be94-00142212c4b1
2008-08-08 18:44:17 +00:00

97 lines
2.3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<refentry xml:id="function.imageistruecolor" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imageistruecolor</refname>
<refpurpose>Finds whether an image is a truecolor image</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>imageistruecolor</methodname>
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
</methodsynopsis>
<para>
<function>imageistruecolor</function> finds whether the image
<parameter>image</parameter> is a truecolor image.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&gd.image.description;
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if the <parameter>image</parameter> is truecolor, &false;
otherwise.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Simple detection of true color image instances using <function>imageistruecolor</function></title>
<programlisting role="php">
<![CDATA[
<?php
// $im is an image instance
// Check if image is a true color image or not
if(!imageistruecolor($im))
{
// Create a new true color image instance
$tc = imagecreatetruecolor(imagesx($im), imagesy($im));
imagecopy($tc, $im, 0, 0, 0, 0, imagesx($im), imagesy($im));
imagedestroy($im);
$im = $tc;
$tc = NULL;
}
// Continue working with image instance
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.gd.2;
</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:"../../../../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
-->