2012-12-04 83 views
0

我有這樣的公共功能:當我預覽圖像出現PNG圖像Alpha顏色問題用PHP

public function resize($width, $height) 
{ 
    $newImage = imagecreatetruecolor($width, $height); 
    if($this->_imageType == IMAGETYPE_PNG && $this->_transparent === true){ 
     imagealphablending($newImage, false); 
     imagesavealpha($newImage, true); 
     imagefilledrectangle($newImage, 0, 0, $width, $height, imagecolorallocatealpha($newImage, 255, 255, 255, 127)); 
    } 
    imagecopyresampled($newImage, $this->_image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); 
    $this->_image = $newImage; 
} 

我的問題。它不顯示阿爾法顏色。我可以得到一些幫助嗎?

回答

0

嘗試設置imagealphablending爲真,沒有虛假。

+0

感謝@selite但沒有... –