2010-06-17 32 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