21,886
社区成员
发帖
与我相关
我的任务
分享
<?php
//创建画布
$img = imagecreatetruecolor(300,100);
//给画布添加颜色
$bg = imagecolorallocate($img,255,0,0);
//设置画布背景色
imagefill($img,5,85,$bg);
header('Content-type:image/jpg');
imagejpeg($img);
<?php
//创建画布
$img = imagecreatetruecolor(300,100);
//设置画布背景色
imagefill($img,5,85,0xff0000);
header('Content-type:image/jpg');
imagejpeg($img);
$r = imagecolorallocate($img, 255,0,0);
echo dechex($r); //ff0000
是你算,还是他替你算