在PHP中将十六进制背景颜色转换为GIF

问题描述:

有什么方法可以将PHP中的十六进制颜色(#fffff)转换为小型的.GIF图像吗?在PHP中将十六进制背景颜色转换为GIF

+1

是的,有。 - –

+0

@皮卡:共享是关怀那里,佩卡.. – StealthRT

+0

请参阅:http://stackoverflow.com/questions/1838794/php-image-creation-from-hex-values-in-database – Tim

....

<?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

为什么这会降低投票率?这是一个难以置信的懒惰问题的答案,但它仍然是一个有效的答案 –

+0

:(有人只是不喜欢我 –

+0

嗯,这很容易重置的影响;) –