位置: 编程技术 - 正文

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)

  • 未确认融资费用和长期应付款
  • 房地产开发企业简易计税方法 可以扣除吗
  • 什么叫抵扣进项
  • 非税收入票据可以手写吗
  • 消费税的账务处理流程
  • 工程项目纳税
  • 专票上不小心印上字了,怎么去除
  • 小规模纳税人利润如何缴税
  • 跨年租赁费如何处理
  • 哪些费用的进项税可以抵扣
  • 两个金税盘能用一个系统
  • 期末存货采用成本与可变现净值孰低法
  • 企业所得税年度申报
  • 个人所得税可以退几年前的?
  • 小企业应收票据有哪些
  • 收到退款如何做账
  • 收取返利发票怎么开具?
  • 汽车贷款利息是什么
  • 单位的收入是刷卡怎么做账
  • 国有资产无偿划转管理办法
  • 多交税费退税会计处理
  • 公允价值变动损益属于当期损益吗
  • 发票打印机的字偏上
  • 金税四期有什么变化
  • 原材料明细账目
  • 印花税资金账簿减免税优惠政策2021
  • 存货进项税额转出会计处理
  • 发票冲红后多交多少税
  • 多给员工交了社保能退回吗
  • 预计毛利率
  • 如何查看windows密钥时间
  • 文件夹不能打开没有反应
  • php加密解密函数高级
  • 待抵扣进项税额和待认证进项税额的区别
  • 建筑劳务公司计提人工劳务费需要工资表吗?
  • 股权投资借差
  • ieview.exe 是什么
  • 怎么启用framework3.5
  • 处理固定资产时的账务处理
  • monolog php
  • 缴纳社保的时候工资填写多少
  • framework3.5启用
  • 以下哪些企业需要填报
  • 免抵退税额怎么计算城建税
  • 转让土地使用权会计分录
  • kibana 教程
  • 支出金额是什么
  • 工程施工的间接费用如何归集分配
  • 门诊报销是怎么报的
  • 待报解预算收入怎么做分录
  • 固定资产清理的含义
  • 资本公积 转增
  • 销售收入打折后怎么做账
  • 注销的企业
  • 收汇结汇以什么汇率入账
  • 汇兑收益怎么做分录
  • 来料加工的增值税怎么核算
  • 个人独资企业个体工商户的区别
  • 原材料入库单应根据采购订单还是到货数量
  • mysql使用or会索引
  • win10图片修改
  • Windows Server 2008系统10个意外惊喜
  • bios没有usb启动项解决方法联想
  • mac怎么连续播放视频
  • 出现早搏就一辈子无法治愈吗
  • windows xp的控制面板
  • 微软撤回快捷键
  • android滑动选择
  • 教你怎样用竹子搭棚子
  • document.location.hash
  • jquery css hover
  • android获取位置信息
  • 新浪微博随时随地
  • shell 执行sh
  • jquery的设计模式
  • js类继承的几种方式
  • python 遍历数组
  • 车险专票怎么做账
  • 企业所得税季申报表
  • 国税申报时间2023年10月
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设