超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<imagecolorstotalimagecopy>
Last updated: Fri, 22 Jun 2007

imagecolortransparent

(PHP 3, PHP 4 , PHP 5)

imagecolortransparent -- 将某个颜色定义为透明色

说明

int imagecolortransparent ( resource image [, int color])

imagecolortransparent()image 图像中的透明色设定为 colorimageimagecreate() 返回的图像标识符,colorimagecolorallocate() 返回的颜色标识符。

注: 透明色是图像的一种属性,透明度不是颜色的属性。一旦设定了某个颜色为透明色,图像中之前画为该色的任何区域都成为透明的。

返回新透明色的标识符,如果省略 color 则返回当前透明色的标识符。




add a note add a note User Contributed Notes
imagecolortransparent
07-Dec-2001 11:18
when a color is defined as transparent, anytime that color is used in another function (before or after transparency definition) will be transparent

ex:
$red = ImageColorAllocate ($im, 233, 14, 91);
$blue = ImageColorAllocate ($im, 0x20, 0x60, 0xaa);
imagefilledarc ($im, 100, 100, 80, 80, 0, 60, $blue, IMG_ARC_PIE);//arc is transparent even though is not defined yet
$trans=imagecolortransparent($im,$blue);//affects all occurances of blue, before and after this line

ALSO:
ImageString ($im, 10, 5, 5,  "Transparent Text String", $blue);
---is equivalent to----
ImageString ($im, 10, 5, 5,  "Transparent Text String", $trans);

<imagecolorstotalimagecopy>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22