Example #1 imagecolorsforindex() 例子

<?php

// 打开一幅图像
$im imagecreatefrompng('nexen.png');

// 取得一点的颜色
$start_x 40;
$start_y 50;
$color_index imagecolorat($im$start_x$start_y);

// 使其可读
$color_tran imagecolorsforindex($im$color_index);

// 显示该颜色的值
echo '<pre>';
print_r($color_tran);
echo 
'</pre>';

?>

本例将输出:

Array
(
    [red] => 226
    [green] => 222
    [blue] => 252
    [alpha] => 0
)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-11-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2022-01-19
  • 2021-04-04
相关资源
相似解决方案