PHP 8.3.4 Released!

imagecolordeallocate

(PHP 4, PHP 5, PHP 7, PHP 8)

imagecolordeallocate取消图像颜色的分配

说明

imagecolordeallocate(GdImage $image, int $color): bool

取消分配先前由 imagecolorallocate()imagecolorallocatealpha() 分配的颜色。

参数

image

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

color

颜色标识符。

返回值

成功时返回 true, 或者在失败时返回 false

更新日志

版本 说明
8.0.0 image 现在需要 GdImage 实例;之前需要有效的 gd resource

示例

示例 #1 使用 imagecolordeallocate()

<?php
$white
= imagecolorallocate($im, 255, 255, 255);
imagecolordeallocate($im, $white);
?>

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top