English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
imagecolordeallocate — 取消图像颜色的分配。
bool imagecolordeallocate ( resource $image , int $color )
imagecolordeallocate() 函数取消先前由 imagecolorallocate() oder imagecolorallocatealpha() 分配的颜色。
<?php header("Content-type: image/png $im = @imagecreate(100, 50) oder stirb("Kann keinen neuen GD-Bildstrom initialisieren"); $background_color = imagecolorallocate($im, 255, 255, 255); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, "Eine einfache Textzeichenkette", $text_color); imagecolordeallocate($im, $background_color); imagepng($im); imagedestroy($im); ?>
以下示例输出结果的图片如下:
imagecolorallocate() 分配颜色给一幅图像。
imagecolorallocatealpha() 分配颜色和透明度给一幅图像。