php-doc-en/reference/image/functions/imageistruecolor.xml
2020-10-09 13:59:15 +00:00

96 lines
2.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<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));
// Copy over the pixels
imagecopy($tc, $im, 0, 0, 0, 0, imagesx($im), imagesy($im));
imagedestroy($im);
$im = $tc;
$tc = NULL;
// OR use imagepalettetotruecolor()
}
// Continue working with image instance
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>imagecreatetruecolor</function></member>
<member><function>imagepalettetotruecolor</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
-->