lily 2007-8-9 14:10
图像颜色的操作
<p><DIV id=art style="MARGIN: 15px">1.imagecolorallocate<BR>语法:int imagecolorallocate(int im,int red,int green,int blue)<BR>该函数的功能是在im为表示的图像中设定RGB模式的颜色,返回值为一个标识,这个标识唯一确定了一个在im图像的颜色,只有使用改函数指定到特定图像中的颜色才能被该图像使用,一个图像中所有实用的颜色都必须用这样的<a href="http://www.phpchina.com/javascript:;" onClick="javascript:tagshow(event, '%B7%BD%B7%A8');" target="_self"><u><strong>方法</strong></u></a>来指定。而且一个图像不能使用另外一个图像中的颜色<BR><BR>2.imagecolortransparent<BR>语法:int imagecolortransparent(int im[,int col])<BR>该函数给图像指定透明的背景色,im为图像的标识,col为使用ImageColorAllocate函数给图像指定的颜色,返回值为新指定的透明色的标识<BR><BR>3.imagecolorat<BR>语法: int imagecolorat(int im,int x,int y)<BR>该函数可以取得图像中的点源素的颜色值。参数im为图形的标识,x和Y分别为图像中的点所在的位置的横坐标和纵坐标<BR><BR>4.imagecolorclosest<BR>语法:int imagecolorclosest(int im,int red,int green,int blue)<BR>该函数可以计算给定的图像中某点的颜色和哪个颜色的索引值最接近,参数im为图像的标识。<BR><BR>5.imagecoloeset<BR>语法:bool imagecolorset(int im,int index,int red,int green,int blue)<BR>该函数可以设定图像的颜色索引表中指定索引的颜色 。 index为指定的索引号<BR><BR>6.imagecolorsforindex<BR>语法:array imagecolorsforindex(int im,int index)<BR>该函数从图像的元素索引表中根据索引号取得指定的颜色<BR><BR>7.imagecolorstotal<BR>语法:int imagecolorstotal(int im)<BR>该函数能探测图像总共使用了多少种颜色<BR><BR><BR>BY:comconn<BR>rainbutterfly<BR>http://coco.cublog.cn<BR><摘:<a href="http://www.phpchina.com/javascript:;" onClick="javascript:tagshow(event, 'PHP');" target="_self"><u><strong>PHP</strong></u></a>高级开发<a href="http://www.phpchina.com/javascript:;" onClick="javascript:tagshow(event, '%BC%BC%CA%F5');" target="_self"><u><strong>技术</strong></u></a>与应用><BR>