imageistruecolor
(PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8)
imageistruecolor — 检查图像是否为真彩色图像
示例
示例 #1 使用 imageistruecolor() 简单检测真彩色实例
<?php
// $im 是图像实例
// 检查图像是否为真彩色图像
if(!imageistruecolor($im))
{
// 创建新的真彩色图像实例
$tc = imagecreatetruecolor(imagesx($im), imagesy($im));
// 复制像素
imagecopy($tc, $im, 0, 0, 0, 0, imagesx($im), imagesy($im));
$im = $tc;
$tc = NULL;
// 或者使用 imagepalettetotruecolor()
}
// 继续使用图像实例
?>
参见
- imagecreatetruecolor() - 新建真彩色图像
- imagepalettetotruecolor() - Converts a palette based image to true color
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/function.imageistruecolor.php