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

  • B4ROK

    B4ROK

    1 EKİM 2008
  • Kayla Caton - Peet

    Kayla Caton

    23 HAZİRAN 2012
  • Randall P Studios

    Randall P St

    27 AĞUSTOS 2009