开发者

Converting hex background color into a GIF in PHP

Is there any 开发者_开发技巧way to convert a hex color (#fffff) into a small .GIF image on the fly with PHP?


....

<?php
// create the image
$im = imagecreatetruecolor(100, 100);

// fill the image with the color you want
imagefilledrectangle($im, 0, 0, 99, 99, 0xFFFFFF);

// set the headers and output the image
header('Content-Type: image/gif');
imagegif($im);
imagedestroy($im);
?>

http://www.php.net/manual/en/function.imagegif.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜