(PHP 4 >= 4.3.2, PHP 5, PHP 7)
imageistruecolor — 锟斤拷锟酵硷拷锟斤拷欠锟轿拷锟斤拷色图锟斤拷
$image
) : bool
imageistruecolor() 锟斤拷锟�
image
图锟斤拷锟角凤拷为锟斤拷锟缴硷拷锟�
锟斤拷锟� image
锟斤拷锟斤拷锟缴硷拷穹祷锟� TRUE
锟斤拷锟斤拷锟津返伙拷 FALSE
锟斤拷
Example #1 Simple detection of true color image instances using imageistruecolor()
<?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
?>
Note: 锟剿猴拷锟斤拷锟斤拷要 GD 2.0.1 锟斤拷锟斤拷甙姹�(锟狡硷拷 2.0.28 锟斤拷锟斤拷锟竭版本)锟斤拷