当前位置: 首页 > 图文教程 > 网络编程 > PHP > PHP开发技巧:PHP关于图像颜色的操作

PHP
php header 详细使用说明与使用心得
php利用header函数实现文件下载时直接提示保存
php $_SERVER当前完整url的写法
PHP 配置open_basedir 让各虚拟站点独立运行
PHP 程序员的调试技术小结
php 静态变量的初始化
php与XML、XSLT、Mysql的结合运用实现代码
php+javascript的日历控件
php 引用(&)详解
PHP小程序自动提交到自助友情连接
PHP 单引号与双引号的区别
PHP 递归效率分析
PHP 进程锁定问题分析研究
phplock(php进程锁) v1.0 beta1
php Memcache 中实现消息队列
MYSQL 小技巧 -- LAST_INSERT_ID
Ajax+PHP 边学边练 之二 实例
php 运行效率总结(提示程序速度)
Ajax PHP 边学边练 之三 数据库
在mysql数据库原有字段后增加新内容

PHP开发技巧:PHP关于图像颜色的操作


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 91 ::
收藏到网摘: n/a

.imagecolorallocate
语法:int imagecolorallocate(int im,int red,int green,int blue)
该函数的功能是在im为表示的图像中设定RGB模式的颜色,返回值为一个标识,这个标识唯一确定了一个在im图像的颜色,只有使用改函数指定到特定图像中的颜色才能被该图像使用,一个图像中所有实用的颜色都必须用这样的方法来指定。而且一个图像不能使用另外一个图像中的颜色

2.imagecolortransparent
语法:int imagecolortransparent(int im[,int col])
该函数给图像指定透明的背景色,im为图像的标识,col为使用ImageColorAllocate函数给图像指定的颜色,返回值为新指定的透明色的标识

3.imagecolorat
语法: int imagecolorat(int im,int x,int y)
该函数可以取得图像中的点源素的颜色值。参数im为图形的标识,x和Y分别为图像中的点所在的位置的横坐标和纵坐标

4.imagecolorclosest
语法:int imagecolorclosest(int im,int red,int green,int blue)
该函数可以计算给定的图像中某点的颜色和哪个颜色的索引值最接近,参数im为图像的标识。

5.imagecoloeset
语法:bool imagecolorset(int im,int index,int red,int green,int blue)
该函数可以设定图像的颜色索引表中指定索引的颜色 。 index为指定的索引号

6.imagecolorsforindex
语法:array imagecolorsforindex(int im,int index)
该函数从图像的元素索引表中根据索引号取得指定的颜色

7.imagecolorstotal
语法:int imagecolorstotal(int im)
该函数能探测图像总共使用了多少种颜色