位置: 编程技术 - 正文

PHP:imagecolorclosestalpha()的用法_GD库图像处理函数

编辑:rootadmin
imagecolorclosestalpha

推荐整理分享PHP:imagecolorclosestalpha()的用法_GD库图像处理函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 4 >= 4.0.6, PHP 5)

imagecolorclosestalpha — 取得与指定的颜色加透明度最接近的颜色

说明 int imagecolorclosestalpha ( resource $image , int $red , int $green , int $blue , int $alpha )

返回图像调色板中与指定的 RGB 值以及 alpha 深度最“接近”的颜色。

参数

image

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

red

红色成分的值。

green

绿色成分的值。

blue PHP:imagecolorclosestalpha()的用法_GD库图像处理函数

蓝色成分的值。

alpha

A value between 0 and . 0 indicates completely opaque while indicates completely transparent.

The colors parameters are integers between 0 and or hexadecimals between 0x and 0xFF.

返回值

Returns the index of the closest color in the palette.

范例

Example #1 Search for a set of colors in an image

<?php//Startwithanimageandconvertittoapalette-basedimage$im=imagecreatefrompng('figures/imagecolorclosest.png');imagetruecolortopalette($im,false,);//Searchcolors(RGB)$colors=array(array(,,,),array(,,,),array(,,,0),array(,,,));//Loopthrougheachsearchandfindtheclosestcolorinthepalette.//Returnthesearchnumber,thesearchRGBandtheconvertedRGBmatchforeach($colorsas$id=>$rgb){$result=imagecolorclosestalpha($im,$rgb[0],$rgb[1],$rgb[2],$rgb[3]);$result=imagecolorsforindex($im,$result);$result="({$result['red']},{$result['green']},{$result['blue']},{$result['alpha']})";echo"#$id:Search($rgb[0],$rgb[1],$rgb[2],$rgb[3]);Closestmatch:$result.n";}imagedestroy($im);?>

以上例程的输出类似于:

注释

Note: 此函数需要 GD 2.0.1 或更高版本(推荐 2.0. 及更高版本)。

参见

imagecolorexactalpha() - 取得指定的颜色加透明度的索引值 imagecolorclosest() - 取得与指定的颜色最接近的颜色的索引值 imagecolorclosesthwb() - 取得与给定颜色最接近的色度的黑白色的索引

PHP:imagecolorallocate()的用法_GD库图像处理函数 imagecolorallocate(PHP4,PHP5)imagecolorallocate为一幅图像分配颜色说明intimagecolorallocate(resource$image,int$red,int$green,int$blue)imagecolorallocate()返回一个标识符,代表了由

PHP:imagechar()的用法_GD库图像处理函数 imagechar(PHP4,PHP5)imagechar水平地画一个字符说明boolimagechar(resource$image,int$font,int$x,int$y,string$c,int$color)imagechar()将字符串c的第一个字符画在image指定的图像中

PHP:imagearc()的用法_GD库图像处理函数 imagearc(PHP4,PHP5)imagearc画椭圆弧说明boolimagearc(resource$image,int$cx,int$cy,int$w,int$h,int$s,int$e,int$color)imagearc()以cx,cy(图像左上角为0,0)为中心在image所代表的图

标签: PHP:imagecolorclosestalpha()的用法_GD库图像处理函数

本文链接地址:https://www.jiuchutong.com/biancheng/288386.html 转载请保留说明!

上一篇:PHP:imagecolorclosest()的用法_GD库图像处理函数

下一篇:PHP:imagechar()的用法_GD库图像处理函数(php中imagecreatefromjpeg)

  • 印花税申报表计税依据怎么填
  • 保障性住房土地增值税预征
  • 印花税贴花是什么时候取消的
  • 营利性医疗机构筹建是什么意思
  • 普票能抵扣多少
  • 个税完税凭证在哪里打印出来
  • 房产未竣工如何缴纳房产税
  • 车辆购置税计税依据包括消费税吗
  • 购买车位需要交哪些税
  • 只有利息费用的财务费用如何结转?
  • 资金型股东溢价进入
  • 股权转让过户费用
  • 个人投资借款长期不还要缴纳个人所得税吗?
  • 建筑业异地预缴税款的会计分录
  • 微信支付有优惠 系统异常
  • 内蒙古地税电子税务局app
  • 分期付款购买商品
  • 房地产企业的非流动资产周转率在多少以上
  • 固定资产清理账户期末有余额吗
  • 投标财务状况报告怎么提供
  • 多抵扣的进项如何做分录
  • win10消费者版本和商业版本有什么区别
  • 常见内存大小
  • 农民专业合作社法
  • php表单的作用是什么
  • php sendmail
  • 预收账款期末余额怎么算
  • 微信小程序登录的账号怎么注销
  • 自己买材料自己装修
  • yolov4tiny网络结构
  • 劳务费发票差额征税
  • Win11 Build 25330 预览版今日更新: 优化 Surface Dial 设置页面
  • 退回的工伤保险会计分录
  • ip6tables-restore命令 还原ip6tables表
  • 日记账对方科目是什么意思
  • linux mysql忘记密码的多种解决或Access denied for user 'root'@'localhost'
  • 劳务分包收入交什么税
  • 汽车车票增值税税率
  • 年会服装费属于什么费用
  • 个人所得税的征税范围
  • sqlsever注释符号
  • 个税专项附加扣除标准调整
  • 实收资本报表怎么填
  • 企业与个人之间关系的理解
  • 出货后90天付款
  • 销售折让的账务处理方法
  • 企业专利权拥有人是指
  • 什么情况需要个人所得税
  • 去税务局开增值税专用发票流程
  • 现金折扣可以扣除吗
  • 公司冲账发票做账流程
  • 租赁房产税计税依据及计算方式是什么
  • 代开专票作废了扣了两次税怎么办?
  • 跨月销项负数发票分录
  • 验资账户需要对账吗
  • 进出口企业外汇额度
  • 旅游业营业税税率
  • 个人独资企业交什么税
  • 产品是如何产生的
  • win10系统的邮件和日历跟outlook一样嘛
  • windowsxp如何清理磁盘
  • mac如何通过终端启动
  • macos rootless
  • freebsd安装mysql
  • windows xp密码忘记怎样解锁
  • gnaupdaemon.exe是什么
  • windows7库功能
  • win10系统中断怎么解除
  • 麒麟系统怎么执行命令
  • 相机渲染图片
  • linux生成文件
  • 利用漏洞每天获利万元
  • 批处理文件可用记事本
  • 异步promise原理
  • 如何查看税务登记信息
  • 小规模纳税人企业所得税怎么征收
  • 车辆购置税是国家收还是地方收
  • 国家税务总局关于新型墙体材料增值税政策的通知
  • 财务审计报告哪个位置可以看出是否亏损
  • 中国的消费税是什么
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设