SORU
23 Kasım 2008, Pazar


PNG PHP ile Şeffaflık

Bazı sorunlar bir küçük resim oluşturmak zaman bir png şeffaflık sağlamak için çalışıyor yaşıyor, Hey kimse bu herhangi bir deneyim? herhangi bir yardım iyi olurdu, burada şu anda bunu yapıyorum:

$fileName= "../js/ajaxupload/tees/".$fileName;

list($width, $height) = getimagesize($fileName);

$newwidth = 257;
$newheight = 197;

$thumb = imagecreatetruecolor($newwidth, $newheight);
imagealphablending($thumb, true);
$source = imagecreatefrompng($fileName);
imagealphablending($source, true);

imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

imagesavealpha($thumb, true);
imagepng($thumb,$newFilename);

CEVAP
23 Kasım 2008, Pazar


Başarı geçmişte bu gibi yaparken buldum

$thumb = imagecreatetruecolor($newwidth, $newheight);
imagealphablending($thumb, false);
imagesavealpha($thumb, true);  

$source = imagecreatefrompng($fileName);
imagealphablending($source, true);

imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

imagepng($thumb,$newFilename);

Çıkış görüntü kalitesi çok iyi imagecopyresampled() imagecopyresized() Daha kullanarak buldum

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • JonnyEthco

    JonnyEthco

    5 EKİM 2006
  • kalabrandmusic

    kalabrandmus

    25 Kasım 2009
  • michellefeng's channel

    michellefeng

    26 Kasım 2006