
The imagecolorat() function gets the index of the color of the pixel.
imagecolorat( $img, $x, $y )
img: Create an image with imagecreatetruecolor() function.
x: The x-coordinate of the point.
y: The y-coordinate of the point.
立即学习“PHP免费学习笔记(深入)”;
本系统经过多次升级改造,系统内核经过多次优化组合,已经具备相对比较方便快捷的个性化定制的特性,用户部署完毕以后,按照自己的运营要求,可实现快速定制会费管理,支持在线缴费和退费功能财富中心,管理会员的诚信度数据单客户多用户登录管理全部信息支持审批和排名不同的会员级别有不同的信息发布权限企业站单独生成,企业自主决定更新企业站信息留言、询价、报价统一管理,分系统查看分类信息参数化管理,支持多样分类信息,
0
The imagecolorat() function returns the color index or FALSE on failure.
The following is an example:
Live Demo
<?php
$img = imagecreatefrompng("http://www.tutorialspoint.com/images/tp-logo-diamond.png");
$rgb = imagecolorat($img, 15, 25);
$colors = imagecolorsforindex($img, $rgb);
var_dump($colors);
?>以下是输出结果:
array(4) { ["red"]=> int(255) ["green"]=> int(255) ["blue"]=> int(255) ["alpha"]=> int(127) }以上就是在PHP中的imagecolorat()函数的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号