位置: - 正文

PHP:imagepalettetotruecolor()的用法_GD库图像处理函数

编辑:rootadmin
imagepalettetotruecolor

推荐整理分享PHP:imagepalettetotruecolor()的用法_GD库图像处理函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5 >= 5.5.0)

imagepalettetotruecolor — Converts a palette based image to true color

说明 bool imagepalettetotruecolor ( resource $src )

Converts a palette based image, created by functions like imagecreate() to a true color image, like imagecreatetruecolor().

参数

imagePHP:imagepalettetotruecolor()的用法_GD库图像处理函数

由图象创建函数(例如imagecreatetruecolor())返回的图象资源。

返回值

Returns TRUE if the convertion was complete, or if the source image already is a true color image, otherwise FALSE is returned.

范例

Example #1 Converts any image resource to true color

<?php//Backwardscompatiblityif(!function_exists('imagepalettetotruecolor')){functionimagepalettetotruecolor(&$src){if(imageistruecolor($src)){return(true);}$dst=imagecreatetruecolor(imagesx($src),imagesy($src));imagecopy($dst,$src,0,0,0,0,imagesx($src),imagesy($src));imagedestroy($src);$src=$dst;return(true);}}//Helperclosure$typeof=function()use($im){echo'typeof($im)='.(imageistruecolor($im)?'truecolor':'palette'),PHP_EOL;};//Createapalettebasedimage$im=imagecreate(,);$typeof();//Convertittotruecolorimagepalettetotruecolor($im);$typeof();//Freethememoryimagedestroy($im);?>

以上例程会输出:

参见

imagecreatetruecolor() - 新建一个真彩色图像 imageistruecolor() - 检查图像是否为真彩色图像

PHP:imagepalettecopy()的用法_GD库图像处理函数 imagepalettecopy(PHP4=4.0.1,PHP5)imagepalettecopy将调色板从一幅图像拷贝到另一幅说明voidimagepalettecopy(resource$destination,resource$source)imagepalettecopy()从source图像把调色

PHP:imageloadfont()的用法_GD库图像处理函数 imageloadfont(PHP4,PHP5)imageloadfont载入一新字体说明intimageloadfont(string$file)imageloadfont()加载一个用户定义的位图字体并返回该字体的标识符(其值总是大于5,

PHP:imagelayereffect()的用法_GD库图像处理函数 imagelayereffect(PHP4=4.3.0,PHP5)imagelayereffect设定alpha混色标志以使用绑定的libgd分层效果说明boolimagelayereffect(resource$image,int$effect)设定alpha混色标志以使用绑定

本文链接地址:https://www.jiuchutong.com/biancheng/288327.html 转载请保留说明!
下一篇链接:https://www.jiuchutong.com/biancheng/288328.html
免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络