2010-06-17 52 views

回答

2
$im = imagecreatefromgif('php.gif'); 
$colorCount = imagecolorstotal($im); 
$colorSet = array(); 
for($i=0; $i<$colorCount; ++$i) { 
    $colorSet[] = imagecolorsforindex($im,$i); 
} 
+0

在我的代码在$ colorSet每个条目就像是一个数组:( [红色] => 226 [绿色] => 222 [蓝色] => 252 α=> 0 ) – 2010-06-17 15:35:32