gpt4 book ai didi

php - 在 PHP 中与 imagerotate() 一起使用的颜色格式是什么?

转载 作者:行者123 更新时间:2023-12-04 06:58:35 25 4
gpt4 key购买 nike

在 PHP 中;函数 imagerotate() 中的背景颜色选项使用什么格式。

$color = "???????";
imagerotate($image, $degrees, $color);

我试过了:
$color = "#FFFFFF";
$color = "255255255";

最佳答案

我认为您必须使用 imagecolorallocate() 指定它:

// sets some colors
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);

// hexadecimal way
$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
$black = imagecolorallocate($im, 0x00, 0x00, 0x00);

通过 the man pages

关于php - 在 PHP 中与 imagerotate() 一起使用的颜色格式是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2226041/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com